Initialize ECWeekView
masterYou can initialize ECWeekView either programmatically or via Storyboard.
Programmatic Initialization
Create an instance by specifying a frame and the number of visible days.
ECWeekView Arguments:
frame: The frame of the calendar view.visibleDays: The number of days visible on one page (Default: 5).date: (Optional) The initial date to load (Default: today).
Storyboard Initialization
- Add a view to your storyboard.
- Set its class to
ECWeekView. - Assign the
dataSourceproperty programmatically in your ViewController.
// Programmatic
let weekView = ECWeekView(frame: frame, visibleDays: 5)
weekView.dataSource = self
addSubview(weekView)
// Storyboard
@IBOutlet weak var weekView: ECWeekView!
weekView.dataSource = self