0
我用我的項目JTAppleCalendar莢文件,當我安裝莢文件我不能使用該方法JTAppleCell我只是可以使用JTAppleDayCell我看了這部影片 https://www.youtube.com/watch?v=Qd_Gc67xzlw 這 https://www.youtube.com/watch?v=zOphH-h-qCs 這裏是我的代碼爲什麼我不能在Swift 3中使用JTAppleCalendar Pod文件JTAppleCell?
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
}
}
我試圖更新但我得到這個錯誤:tar:無法識別的存檔格式 tar:錯誤退出延遲從以前的錯誤。 –
在這種情況下,你可以做一個'pod --version'嗎?我說1.2.1;如果你的椰子樹本身已經過時,那就嘗試更新椰子樹本身。如果一切都失敗了,那麼嘗試把它放在你的podfile中並運行一個'pod install'。把它放在pod文件中 - >'pod'JTAppleCalendar',::git =>'https://github.com/patchthecode/JTAppleCalendar.git',:branch =>'master'' –