I have a UICollectionView. When the user taps on an item, a modal form sheet window appears over the view. When the user taps done, I want to call [self.collectionView reloadData]
, or something that does the equivalent. However, viewWillAppear
does not work for the form sheet. Any idea how to get this to work?
Someone on the Apple Dev forums helped me. For reference: Put this in the CollectionView Controller. - (IBAction)formSheetWindowDoneButtonPressed:(UIStoryboardSegue *)sender { [self.collectionView reloadData]; }
You can change the name of the method, but keep the rest of the signature the same. Now, in the storyboard, control+drag from your done button to the exit segue for that view controller. That's the green box at the bottom of the view with the arrow pointing to the right. When you let go of the drag, you should see formSheetWindowDoneButtonPressed: as an option. Pick that one, and you've now linked your Exit Segue appropriately. When they press done, the method above is called and your collection view reloads.