小编Bub*_*tle的帖子

从修补代码重新创建 JTAppleCalender 时遇到问题

我在尝试从 patchthecode 的教程中重新创建日历时遇到了一些问题 这是链接:https ://patchthecode.github.io/MainTutorial2/ 。以下是我遇到的一些错误:

1.无法将“ViewController”类型的值分配给“UICollectionViewDataSource”类型?

2.无法将“ViewController”类型的值分配给“UICollectionViewDelegate”类型?

3.“JTAppleCalendarView?”类型的值 没有成员“registerCellViewXib”

4.“JTAppleCalendarView?”类型的值 没有成员“cellInset”

5.未声明类型'DateCell'的使用

6.'calendar(_:cellForItemAt:cellState:indexPath:)'的无效重新声明

7.使用未解析的标识符“myCustomCell”

import UIKit
import JTAppleCalendar
class ViewController: UIViewController {
    let white = UIColor.white
    let darkPurple = UIColor.purple
    let dimPurple = #colorLiteral(red: 0.5568627715, green: 0.3529411852, blue: 0.9686274529, alpha: 1)
@IBOutlet weak var calendarView: JTAppleCalendarView!
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        super.viewDidLoad()
        calendarView.dataSource = self
        calendarView.delegate = self
        calendarView.registerCellViewXib(file: "CellView") // Registering your cell is …
Run Code Online (Sandbox Code Playgroud)

calendar ios swift jtapplecalendar

5
推荐指数
0
解决办法
447
查看次数

标签 统计

calendar ×1

ios ×1

jtapplecalendar ×1

swift ×1