Skip to content

Commit

Permalink
Update DLPhotoTableViewController.m
Browse files Browse the repository at this point in the history
  • Loading branch information
darling0825 authored Jun 17, 2017
1 parent 8e48bcf commit e2afc70
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions DLPhotoPicker/Controller/DLPhotoTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ - (void)viewDidLoad {
[self fetchPhotoCollectionAndReload];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];

[self setupPhotoCollection];
[self.tableView reloadData];
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];

[[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)applicationWillEnterForeground:(NSNotification *)notification {
[self fetchPhotoCollectionAndReload];
}


- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
self.photoCollections = nil;
Expand Down

0 comments on commit e2afc70

Please sign in to comment.