Implement properties using associated objects
This file contains 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
@implementation UIViewController (RBPopoverPrivate) | |
- (UIPopoverController *)hiddenPopoverController { | |
return objc_getAssociatedObject(self, HiddenPopoverControllerKey); | |
} | |
- (void)setHiddenPopoverController:(UIPopoverController *)hiddenPopoverController { | |
objc_setAssociatedObject(self, HiddenPopoverControllerKey, hiddenPopoverController, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
} | |
- (UIViewController *)hiddenPopoverContent { | |
return objc_getAssociatedObject(self, HiddenPopoverContentKey); | |
} | |
- (void)setHiddenPopoverContent:(UIViewController *)hiddenPopoverContent { | |
objc_setAssociatedObject(self, HiddenPopoverContentKey, hiddenPopoverContent, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
} | |
// plus many more ... | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment