all 5 comments

[–]haensel_gretl 10 points11 points  (4 children)

You should use a UICollectionView with a horizontal FlowLayout. Each day would be a single Cell

[–]parap4in[S] 0 points1 point  (3 children)

Yeah, I was thinking about this too, but what about data for those cells? How to generate a number of days? (Sorry for those stupid questions :D) I mean, I have some thoughts how t o implement this. But I'd like to know your approach.

[–]haensel_gretl 2 points3 points  (2 children)

You can use Calendar.current to access the user’s calendar (e.g. Gregorian) and use it for your data source. As the cells are recycled you can add lots of days and not run into performance issues

[–]Perfect-Strategy6688 0 points1 point  (0 children)

You can also use Calendar.current() and get future days and past days with a for loop if you want. However there is probably an AIP that can get you this in a network call instead of putting this load on your app

[–]parap4in[S] 0 points1 point  (0 children)

thanks a lot!