On a table row click I reference a cell to present a view controller (to select from a list of images)
def open_selector
view_b = ImagesController.new #using rmq hence .new
@@cell.superview.superview.controller.presentViewController view_b, animated:true, completion:nil
end
Inside the images controller - I dismiss when finished selecting - but how do I let cell know it was closed?
def collectionView(view, didSelectItemAtIndexPath: index_path)
self.dismissViewControllerAnimated(true, completion: lambda{})
end
I would suggest providing your
UICollectionViewControllera delegate so it can call back itself. So:Assuming, you have a method called
collection_did_closein the parent controller, it will be called with a reference to the collection view controller. Using that you can grab whatever information you need out of there before it gets garbage collected.