Ios 这套设备不工作
我按照说明在我的应用程序中使用MBCalendarKit,但它似乎不起作用。我在下面用swift发布我的代码Ios 这套设备不工作,ios,iphone,swift,mbcalendarkit,Ios,Iphone,Swift,Mbcalendarkit,我按照说明在我的应用程序中使用MBCalendarKit,但它似乎不起作用。我在下面用swift发布我的代码 import UIKit class ViewController: CKCalendarViewController, CKCalendarViewDelegate , CKCalendarViewDataSource { var data : NSMutableDictionary override init() { self.data = NSMutableDictionary
import UIKit
class ViewController: CKCalendarViewController, CKCalendarViewDelegate , CKCalendarViewDataSource {
var data : NSMutableDictionary
override init() {
self.data = NSMutableDictionary()
super.init()
}
required init(coder aDecoder: NSCoder) {
data = NSMutableDictionary()
super.init(coder: aDecoder)
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
self.data = NSMutableDictionary()
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Step 0 : Wire up the data source and delegate
self.delegate = self
self.dataSource = self
// Step 1 : Define some events
let title : NSString = NSLocalizedString("Add Swift Demo", comment: "")
let date : NSDate = NSDate(day: 9, month: 1, year: 2015)
let event : CKCalendarEvent = CKCalendarEvent(title: title, andDate: date, andInfo: nil)
// Step 2 : Add the events to the cache array
self.data[date] = [event]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
// MARK: - CKCalendarDataSource
func calendarView(calendarView: CKCalendarView!, eventsForDate date: NSDate!) -> [AnyObject]! {
return self.data.objectForKey(date) as [AnyObject]!
}
override func calendarView() -> CKCalendarView! {
return CKCalendarView()
}
}
"
安装mbcalendarKit。可以在此处找到说明
另外,我认为podfile存在问题,但这似乎不是问题所在。提前感谢。目前没有错误,构建成功。运行代码时会发生什么情况?我构建了自己的自定义日历。哦,好吧。我是MBCalendarKit的开发人员,因此如果您需要任何信息,请致电。