Last active
July 9, 2016 02:36
-
-
Save joshavant/b9cb036f8b1543123aaed5e165b3b34c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if context == &FooKVOContext { | |
// .CGSizeValue can cause a sneaky segfault here, because it will execute on ALL keyPaths (not just "contentSize") | |
if let newContentSize = change?[NSKeyValueChangeNewKey]?.CGSizeValue() where keyPath == "contentSize" { | |
// do things | |
} | |
} else { | |
super.observeValueForKeyPath(keyPath, ofObject: object, change: change, context: context) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment