TBRepeatPicker 1.1.1

TBRepeatPicker 1.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2015
SPMSupports SPM

Maintained by Hong Xin.



  • By
  • Xin Hong

TBRepeatPicker

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!

Screenshot

Screenshot

Screenshot

How To Get Started

Podfile

platform :ios, '8.0'
pod "TBRepeatPicker"

Usage

1. Create and present 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.

2. Implement didPickRecurrence delegate
func didPickRecurrence(recurrence: TBRecurrence?, repeatPicker: TBRepeatPicker) {
    // do something
}

Minimum Requirement

iOS 8.0

Localization

TBRepeatPicker supports 5 languages: English, SimplifiedChinese, TraditionalChinese, Korean, Japanese. You can set the language when init.

Swift and Objective-C

TBRepeatPicker support both Swift and Objective-C.

in Objective-C, you just need to import a header like this:

#import "MyApp-Swift.h"

Release Notes

License

Mantle is released under the MIT license. See LICENSE for details.

More Info

Have a question? Please open an issue!