私は UICollectionViewDataSource に従っていると思いますが、コンパイラはそうではないと言っています。
私は何が欠けていますか?
import Foundation
import UIKit
class InviteFriendsViewController:UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
@IBOutlet weak var collectionView: UICollectionView!
@IBAction func navButtonAction(sender: UIBarButtonItem) {
}
@IBAction func segmentedControlAction(sender: UISegmentedControl) {
}
// -----------------------------------------------------------------------------------------------------
// MARK: UICollectionViewDataSource
func collectionView(collectionView: UICollectionView, section: Int) -> Int {
return 1
}
func collectionView(collectionView: UICollectionView, indexPath: NSIndexPath) -> UICollectionViewCell {
let cell: AnyObject = collectionView.dequeueReusableCellWithReuseIdentifier("InviteFriendsVC", forIndexPath:indexPath)
return cell as UICollectionViewCell
}
}
必要な API をカバーする関数が 2 つありますが、このコンパイラ エラーが発生します。
なんで?