-
-
Save alikaragoz/8516746 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
// Defines a yet undocumented method to add a warning if super isn't called. | |
#ifndef NS_REQUIRES_SUPER | |
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#else | |
#define NS_REQUIRES_SUPER | |
#endif | |
#endif | |
@interface UIViewController (SubclassingWarnings) | |
// PSPDFKit overrides all kind of event hooks for UIViewController. | |
// You should always call super on those, even if you're just using UIViewController. | |
- (void)viewWillAppear:(BOOL)animated NS_REQUIRES_SUPER; | |
- (void)viewDidAppear:(BOOL)animated NS_REQUIRES_SUPER; | |
- (void)viewWillDisappear:(BOOL)animated NS_REQUIRES_SUPER; | |
- (void)viewDidDisappear:(BOOL)animated NS_REQUIRES_SUPER; | |
- (void)viewWillLayoutSubviews NS_REQUIRES_SUPER; | |
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration NS_REQUIRES_SUPER; | |
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration NS_REQUIRES_SUPER; | |
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation NS_REQUIRES_SUPER; | |
- (void)didReceiveMemoryWarning NS_REQUIRES_SUPER; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment