diff --git a/DLPhotoPicker/Controller/DLPhotoTableViewController.m b/DLPhotoPicker/Controller/DLPhotoTableViewController.m index d7b700e..14043c2 100755 --- a/DLPhotoPicker/Controller/DLPhotoTableViewController.m +++ b/DLPhotoPicker/Controller/DLPhotoTableViewController.m @@ -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;