我的didSelectItemAt方法没有被调用,也没有任何东西被打印到控制台中。我打开了用户交互,但仍然无法打印出任何内容。我不确定是我的自定义 PinterestStyle 布局导致了这个还是我遗漏了什么。最终目标是进入显示所选单元格的配置文件页面的详细视图控制器。我会使用prepareForSegue但是我仍然无法让它在点击时打印出单元格的名称。
class PagesCollectionViewController: UICollectionViewController, firebaseHelperDelegate {
var storageRef: StorageReference!{
return Storage.storage().reference()
}
var usersList = [String]()
var authService : FirebaseHelper!
var userArray : [Users] = []
var images: [UIImage] = []
var names: [String] = []
override func viewWillAppear(_ animated: Bool) {
if Global.Location != "" && Global.Location != nil
{
usersList = Global.usersListSent
print(usersList)
self.authService.ListOfUserByLocation(locationName: Global.Location, type: .ListByLocation)
}
}
override func viewDidLoad() {
self.collectionView?.allowsSelection = true
self.collectionView?.isUserInteractionEnabled = true
super.viewDidLoad()
self.authService = …Run Code Online (Sandbox Code Playgroud)