我正在编码UIViewCollection以从Firebase数据库中获取一些数据。 我不确定为什么会收到此错误。我确实创建了一个包含所有信息以连接到Firebase的Workers文件,但仍然收到“ Type'Workers.Type'没有下标成员”
我在这里有工作文件:
class Workers {
var workerName = ""
var workerFrequency = ""
var workerLocation = ""
var workerNextAppointment = ""
}
我的问题是在配置收集视图必填字段时。见下文;
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return user.count
}
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return 1
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WorkerCell", for: indexPath) as! WorkerCell
let cellUsers = Workers[indexPath.item]
cell.workerName.text = cellUsers.name
cell.workerLocation.text = ""
return cell
//if let profileImageURL = cellUsers.profileImageURL {
// cell.usersImageView.loadImageUsingCacheWithUrlString(urlString: profileImageURL)
}
}
有人知道这里出什么问题吗?