Objective c 如何以与一周中的月份和日期相匹配的方式在日历中以编程方式布局日期?
我该怎么做 我相信这是以前做过的。我在github上检查了几个项目,比如calendar master,但它们都比我需要的复杂 2013年10月 S M T W T F S 30123456 78991011213 141617181920 2122232425627 28293031123 有没有最好的方法来做到这一点?以与该月的星期几相匹配的方式安排日期 这将在tableview中进行,但我不是在寻找代码,只是寻找其背后的逻辑。除非已经有一个很好的解决方案Objective c 如何以与一周中的月份和日期相匹配的方式在日历中以编程方式布局日期?,objective-c,uitableview,uicollectionview,Objective C,Uitableview,Uicollectionview,我该怎么做 我相信这是以前做过的。我在github上检查了几个项目,比如calendar master,但它们都比我需要的复杂 2013年10月 S M T W T F S 30123456 78991011213 141617181920 2122232425627 28293031123 有没有最好的方法来做到这一点?以与该月的星期几相匹配的方式安排日期 这将在tableview中进行,但我不是在寻找代码,只是寻找其背后的逻辑。除非已经有一个很好的解决方案 谢谢大家! 逻辑可以是这样的(伪代
谢谢大家! 逻辑可以是这样的(伪代码):
get the weekday of the first day of the month in question
determine the number of days of the previous month
fill the first line
with leading final days of previous month, if any
the remaining days for the first week of the month in question
fill all other lines
fill the rest of the last line
with the first days of the following month, if any space left