vendredi 27 février 2015

MBCalendarKit not working

i have followed as per instruction to use MBCalendarKit into my app but it doesn't seem to be working . I am posting my code below in swift .



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()
}
}


" install mbcalendarKit . instruction can be found over here http://ift.tt/1eu8QiT


also i think the problem is with podfile but that doesn't seem to be the issue. thanks in advance.




Aucun commentaire:

Enregistrer un commentaire