0

I try to add a an UICollectionView as a subview of a keywindow so that this collectionview is visible in every ViewController of my application.So how can I add collection view on keywindow and how or which class is used for updating in future?

MD. Rejaul Hasan
  • 168
  • 1
  • 15
  • 1
    I would suggest a different approach, building a layout using a view controller with two container views, one that contains a UICollectionViewController and another that contains the rest of your app's View Controllers – JAB Aug 08 '17 at 22:44
  • Thank @BJHStudios for your suggestion.I also think about it but I end up with a problem.My rest of the app view controllers have collection views table views.When I select one of the cell of any collection view or table view from those VC I need to pass an object to my every time visible collection view because I need to update my visible collection view with related data.But how do I pass data every time to my visible collection view??Thanks . – MD. Rejaul Hasan Aug 09 '17 at 05:26
  • You can do that either using the delegate pattern or through a notification with NotificationCenter – JAB Aug 09 '17 at 21:33
  • can you please share me with some example code and screen shot.I am stuck with it because I already try it but not working.The scenario is something like that.I have a tab bar with 2 tabs.both tabs have VC where the VC has tableview or collection view.If I select 1 cell of any VC's table view or collection view I just need to pass an object to the always visible collection view. – MD. Rejaul Hasan Aug 10 '17 at 06:58

0 Answers0