Skip to content

Instantly share code, notes, and snippets.

@d-amend
Created June 12, 2013 08:18
Show Gist options
  • Save d-amend/5763626 to your computer and use it in GitHub Desktop.
Save d-amend/5763626 to your computer and use it in GitHub Desktop.
Enforce calling super in Objective C superclasses (generates warning)
#import <UIKit/UIKit.h>
@interface DAMCustomViewController : UIViewController
//Enforce calling super
- (void)viewWillAppear:(BOOL)animated __attribute__((objc_requires_super));
- (void)viewDidAppear:(BOOL)animated __attribute__((objc_requires_super));
- (void)viewWillDisappear:(BOOL)animated __attribute__((objc_requires_super));
- (void)viewDidDisappear:(BOOL)animated __attribute__((objc_requires_super));
- (void)viewDidLoad __attribute__((objc_requires_super));
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment