Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
iOS Week 2
* Select Image View Mode for Image Resizing if its bigger than the screen.
* Delegate - Add callbacks somewhere else when something changes.
* protocol and interface are synonyms in objc.
Delegate Pattern
* Can use delegate instead of passing around controllers.
* Mark protocol methods as @optional if you dont need them.
* Check this via respondsToSelector method.
* Don't use for 1:1 relationship. Use delegates instead.
* Better to use when there is a 1:many relationship. Eg., when a keyboard appears, reposition your views.
* More useful especially when you don't own the object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment