Skip to content

Instantly share code, notes, and snippets.

@reddragon
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reddragon/b43132bfe5801ca90466 to your computer and use it in GitHub Desktop.
Save reddragon/b43132bfe5801ca90466 to your computer and use it in GitHub Desktop.
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.
* KVO
* 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