Skip to content

Instantly share code, notes, and snippets.

@averydev
Created April 28, 2014 18:31
Show Gist options
  • Save averydev/11380185 to your computer and use it in GitHub Desktop.
Save averydev/11380185 to your computer and use it in GitHub Desktop.
ViewController template
#pragma mark - Standard VC state management
- (void)viewDidLoad
{
[super viewDidLoad];
/*
One-time setup tasks here
*/
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// Register for notification.
[self refresh];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self];
//Cleanup
}
- (void)refresh
{
// Fetch data.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Notification handling
/*
Handle notifications here - reload tables, etc.
- (void)fetchedObject:(NSNotification*)notification
{
PLObject *object = [[notification userInfo] objectForKey:PLFetchedObjectNotification];
}
*/
#pragma mark - Event handling
/// Handle Events.
#pragma mark - Delegates
//Delegate Methods
#pragma mark - Helpers
//Helpers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment