我正在阅读一本来自“Hacking with Swift”的书:Paul Hudson。我正在遵循所有步骤,但是几天前我触及了一些我认为不应该做的事情。我现在已经得到了过去一天的这个错误,我之前使用过相同的方法并且它有效,但我不知道发生了什么或者我触摸了什么。谁能帮我?
这是我的代码:
import UIKit
class ViewController: UICollectionViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 10
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Person", for: indexPath) as! PersonCell
return cell
}
}