Sunday, 16 June 2019

How do I add a refresh control to a horizontal collectionview in a view controller?

I currently have:

        refresher = UIRefreshControl()
    refresher.attributedTitle = NSAttributedString(string: "Pull to refresh")
    refresher.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged)
    self.postsView.addSubview(refresher)

inside the viewdidload() of the viewcontroller containing the collectionview. Interacting with the collectionview and getting custom cells to appear works flawlessly. However, when I add this refresher, it does not do anything. I'm not sure as to why, am i missing a step here? Thanks!



from How do I add a refresh control to a horizontal collectionview in a view controller?

No comments:

Post a Comment