TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2015 |
SPMSupports SPM | ✗ |
Maintained by Hong Xin.
TBRepeatPicker is an event repeat rule picker similar to iOS system calendar. You can easily apply it in your project and you’ll be happy to do it!
platform :ios, '8.0'
pod "TBRepeatPicker"
// give the occurrence date of event
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
occurrenceDate = dateFormatter.dateFromString("2015-09-25")!
// init picker
let repeatPicker = TBRepeatPicker.initPicker(occurrenceDate, language: .English, tintColor: UIColor.blueColor())
// assign a recurrence to the picker, you can pass nil or do nothing here when the repeat rule is "Never".
repeatPicker.recurrence = TBRecurrence.initMonthly(1, selectedMonthdays: [3, 17], occurrenceDate: occurrenceDate)
// set delegate
repeatPicker.delegate = self
// push picker
navigationController?.pushViewController(repeatPicker, animated: true)
Note: You should always use push segue here to present the picker, TBRepeatPicker doesn’t support other segues such as modal.
func didPickRecurrence(recurrence: TBRecurrence?, repeatPicker: TBRepeatPicker) {
// do something
}
iOS 8.0
TBRepeatPicker supports 5 languages: English, SimplifiedChinese, TraditionalChinese, Korean, Japanese. You can set the language when init.
TBRepeatPicker support both Swift and Objective-C.
in Objective-C, you just need to import a header like this:
#import "MyApp-Swift.h"
Mantle is released under the MIT license. See LICENSE for details.
Have a question? Please open an issue!