-Select on the specified date when the screen changes with FS Calendar. ・ I was having trouble specifying the date at the screen transition destination, so I will write it in Qiita.
ViewController.swift
@IBOutlet weak var calView: FSCalendar!
override func viewWillAppear(_ animated: Bool) {
let calPosition = Calendar.current
//The date specified here is an Int type
let selectDay = calPosition.date(from: DateComponents(year: 2020, month: 11, day: 5))
calView.select(selectDay)
}
-Date specified in Date Components is Int type -I am casting to Int because the value obtained on another screen is String. -It is written in Int type for easy viewing.
Recommended Posts