• bfalling

    Nice example. It might be worth mentioning that this is the Delegate Pattern, one of the core Cocoa design patterns.

    • Very good point! Thank you very much!

  • Roel Spruit

    Since the delegate property of the SecondViewController is an optional, this line will cause an error: delegate.setResultOfBusinessLogic(fullName). Instead unwrap the optional before using it:

    if let del = delegate {
    del.setResultOfBusinessLogic(fullName)
    }

    of use optional chaining to do it in one go: delegate?.setResultOfBusinessLogic(fullName)

  • Rodrigo Vieira

    Can i use the NSNotificationCenter to pass informations between classes?

    • Clément Sauvage

      Sure you can, but globally the accepted pattern is delegation

      Concerning datas
      – Passing forward, you should use `prepareForSegue`
      – Passing backward, you should use delegation
      – Passing to multiple things (VC, M…) : use `NSNotificationCenter`

  • Daryl Wong

    So I have just gone through the 3 related youtube tutorials. Do you have the project files that I can download?

  • VotaNO

    Great Tutorial. THANKS!!