0

What is exactly created in this function?

I'm trying to create a reusable extension so that every UIViewController can hold a reference to the NSObjectProtocol observer that's returned in this function. The observer doesn't seem to be the object that called the function.

so where is it created?

Bhavesh Nayi
  • 3,626
  • 1
  • 27
  • 42
Huy-Anh Hoang
  • 777
  • 6
  • 24
  • 1
    Read the discussion in the reference documentation for that method. The return value is only needed to call `removeObserver`. – rmaddy Apr 26 '19 at 22:52
  • Yes, but what is the observer? Is there a good way to store this somewhere until I'm ready to reference it again? I'm trying to make the flow reusable for different view controllers – Huy-Anh Hoang Apr 26 '19 at 23:10
  • For this specific `addObserver` method, the "observer" is the owner of the closure passed to the `using` parameter. – rmaddy Apr 26 '19 at 23:16

0 Answers0