FSCalendar icon indicating copy to clipboard operation
FSCalendar copied to clipboard

in swift example i created two buttons: week, month with corresponding actions.

Open iOSayedAhmed opened this issue 3 years ago • 1 comments

@IBAction func monthView(sender: UIButton) {
    self.calendar.setScope(.Month, animated: true)
}

@IBAction func weekView(sender: UIButton) {
    self.calendar.setScope(.Week, animated: true)
}

iOSayedAhmed avatar Nov 12 '21 17:11 iOSayedAhmed

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.

justdan0227 avatar May 04 '22 12:05 justdan0227