以下のソースコードで題名通りのエラーが発生しています。
UICollectionViewDataSourceに必要最低限のメソッドは定義したつもりですが、
解決されません。
足りないメソッドなど、ご教授お願いします。
swift
1class CalendarViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { 2 3 @IBOutlet weak var calenderCollectionView: UICollectionView! 4 @IBOutlet weak var headerTitle: UILabel! 5// 中略 6 7 override func viewDidLoad() { 8 super.viewDidLoad() 9 10 calenderCollectionView.delegate = self 11 calenderCollectionView.dataSource = self 12 calenderCollectionView.backgroundColor = UIColor.whiteColor() 13 headerTitle.text = changeHeaderTitle(selectedDate) 14 } 15 16 func colectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 17 if section == 0 { 18 return 7 19 } else { 20 return dateManager.daysAcquisition() 21 } 22 } 23 24 func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { 25 let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! CalendarCell 26 if indexPath.row % 7 == 0 { 27 cell.textLabel.textColor = UIColor.lightRed() 28 } else if indexPath.row % 7 == 6 { 29 cell.textLabel.textColor = UIColor.lightBlue() 30 } else { 31 cell.textLabel.textColor = UIColor.grayColor() 32 } 33 34 if indexPath.section == 0 { 35 cell.textLabel.text = self.weekArray[indexPath.row] 36 } else { 37 cell.textLabel.text = dateManager.conversionDateFormat(indexPath) 38 } 39 return cell 40 } 41 42 // 中略 43}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。