首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我不能在Swift 3中使用JTAppleCalendar Pod文件JTAppleCell?

为什么我不能在Swift 3中使用JTAppleCalendar Pod文件JTAppleCell?
EN

Stack Overflow用户
提问于 2017-06-05 09:37:17
回答 1查看 929关注 0票数 0

我在我的项目中使用了一个JTAppleCalendar pod文件,当我安装pod文件时,我不能使用JTAppleCell方法,我只需要使用JTAppleDayCell,我看了这个视频Gc67xzlw,这里的https://www.youtube.com/watch?v=zOphH-h-qCs是我的代码

代码语言:javascript
复制
import UIKit
import JTAppleCalendar

class calendarViewController: UIViewController {


@IBOutlet weak var calendarCollectionView: UICollectionView!


let formatter = DateFormatter()

override func viewDidLoad() {
    super.viewDidLoad()


}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()

}


}

extension calendarViewController : JTAppleCalendarViewDataSource {


func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
    formatter.dateFormat = "yyyy MM dd"
    formatter.timeZone = Calendar.current.timeZone
    formatter.locale = Calendar.current.locale


    let startDate = formatter.date(from: "2017 01 01")!
    let endDate = formatter.date(from: "2017 12 31")!

    let parameters = ConfigurationParameters(startDate: startDate, endDate: endDate)
    return parameters
}


func calendar(_calebdar : JTAppleCalendarView , cellForItemAt date : Date , cellState : CellState , indexPath : IndexPath ) -> JTAppleDayCell {

    let cell = calendarCollectionView.dequeueReusableCell(withReuseIdentifier: "JTCustomCell", for: indexPath) as! JTCustomCell
    cell.dateLabel.text = cellState.text

    return cell
}

}
EN

回答 1

Stack Overflow用户

发布于 2017-06-07 01:51:14

如果您只能使用JTAppleDayCell而不是JTAppleCell,那么您使用的是错误的库版本。那个视频给你看了7.0版

所以我现在问的问题是你用的是什么版本?把这个放到你的文件里:

代码语言:javascript
复制
pod 'JTAppleCalendar'

然后转到控制台并运行pod update

版本应该是7.0.4 (这是目前为止的最新版本)。如果它说的是其他版本,那你就做错了什么。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44365933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档