AMCalendar
is a calendar can select date.
Create calendar.
let calendar =
AMCalendar.setCalendar(onView: view, parentViewController: self,
selectedDate: Date(), delegate: self)
Conform to the protocol in the class implementation.
func calendar(_ calendar: AMCalendar, didSelectDate date: Date?) {
// use selected date here
}
AMCalendar
can be customized via the following properties.
public var headerColor: UIColor = .gray
public var monthTextColor: UIColor = .black
public var defaultDateTextColor: UIColor = .black
public var disabledDateTextColor: UIColor = .lightGray
public var sundayTextColor: UIColor = .red
public var saturdayTextColor: UIColor = .init(red: 25.0 / 255.0 , green: 105.0 / 255.0, blue: 255.0 / 255.0 , alpha: 1.0)
public var selectedDateTextColor: UIColor = .white
/// Circle color
public var selectedDateColor: UIColor = .red
/// Circle border color
public var nowDateColor: UIColor = .green
/// Locale used in header
///
/// default is Locale(identifier: Locale.preferredLanguages.first!)
public var locale: Locale?
sample
calendar.headerColor = .purple
calendar.monthTextColor = .yellow
calendar.defaultDateTextColor = .orange
calendar.disabledDateTextColor = .brown
calendar.sundayTextColor = .green
calendar.saturdayTextColor = .cyan
calendar.selectedDateTextColor = .blue
calendar.selectedDateColor = .magenta
calendar.nowDateColor = .black
calendar.locale = Locale(identifier: "ja_JP")
Add this to your Podfile.
pod 'AMCalendar'
Add this to your Cartfile.
github "adventam10/AMCalendar"
MIT