1.
- (CustomNavigationControllerDelegate *)customDelegate { return objc_getAssociatedObject(self, _cmd); } - (void)setCustomDelegate:(CustomNavigationControllerDelegate *)customDelegate { objc_setAssociatedObject(self, @selector(customDelegate), customDelegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }
https://www.jianshu.com/p/fdb1bc445266