我在UICollectionViewController
分钟时使用了以下代码
override func viewDidLoad() {
self.collectionView!.alwaysBounceVertical = true
let refresher = UIRefreshControl()
refresher.addTarget(self, action: "refreshStream", forControlEvents: .ValueChanged)
refreshControl = refresher
collectionView!.addSubview(refreshControl!)
}
func refreshStream() {
print("refresh")
self.collectionView?.reloadData()
refreshControl?.endRefreshing()
}
现在我需要它在UIViewController
中与UICollectionView
一起工作,我在谷歌上搜索了一个小时,但无法让它工作.