FSCalendar
FSCalendar copied to clipboard
in swift example i created two buttons: week, month with corresponding actions.
@IBAction func monthView(sender: UIButton) {
self.calendar.setScope(.Month, animated: true)
}
@IBAction func weekView(sender: UIButton) {
self.calendar.setScope(.Week, animated: true)
}
I know you asked this quite a while ago, but I just did this and it appears to work just fine.
Remember to add func calendar(_ calendar: FSCalendar, boundingRectWillChange bounds: CGRect, animated: Bool) { self.calendarHeightConstraint.constant = bounds.height self.view.layoutIfNeeded() } and that your ViewController conforms to :
class ViewController: UIViewController,FSCalendarDataSource, FSCalendarDelegate
and that you have a
@IBOutlet weak var calendarHeightConstraint: NSLayoutConstraint!
set to the height constraint from the storyboard.