0

Could you tell me the equivalent of:

var didTapURL: ((_ url: URL) -> Void)?

..........

myObject.didTapURL = { [weak self] (url) in
     self?.manageUrl(url)
}

in Objectice-C?

TylerP
  • 9,600
  • 4
  • 39
  • 43
Anthony
  • 2,801
  • 3
  • 30
  • 49

1 Answers1

1

It is __weak, see below

__weak __typeof(self) weakSelf = self;

// ...

    dispatch_async(dispatch_get_main_queue(), ^{
      [weakSelf call_some_selector];
    });
Asperi
  • 228,894
  • 20
  • 464
  • 690