I'm trying to create a custom calendar/ month view from scratch similar to this:
And with that I'm wondering what the correct approach would be. I'm calculating which weekday the first day of the month falls on (mon-sun), and the number of days in the month. This should be enough to determine how the calendar should look, but I'm stuck trying to figure out a way to lay this all out.
Is it best to have 37 buttons in a grid layout in the storyboard and iterate through them somehow, changing their label, or dynamically create these buttons on the fly? Is there any element/ framework in iOS I could make use of to make this process easier?
If going for the latter, how would you set up the constraints to make this scalable on different size classes and screen sizes?
Tim in first comment is right. The best way to build layout for custom calendar view such yours is UICollectionView.
Also to make less mistakes you can use NSDate extensions like this one: https://github.com/erica/NSDate-Extensions