Code Monkey home page Code Monkey logo

llcalendar's Introduction

LLCalendar

简单的日历,由于项目涉及到了,本来打算找轮子,可是拓展太繁琐了,就自己写了个简单的,超级容易拓展。

(Demo)

对象存储MonthModel

* 你可以在模型里自由拓展你要存储的对象。

天的信息显示CalendarCell,继承于UICollectionViewCell

*这个你应该更熟悉了,所以想怎么显示就怎么显示,想加入什么动画,可谓收放自如了就。

礼拜信息的显示CollectionViewHeader,继承于UICollectionReusableView

*你可以自己控制显示样式,显示的信息,显示的方式。

通过上面的一番描述,这就是日历,让你显示的收放自如。

也许我写的日历没有那么高性能,你可以优化,希望你优化的同时可以issues我,当提点我一下了哦。

由于所有的代码现在一个文件中,所以你可以把方法抽出来,维护到代码里,这样更易读。

llcalendar's People

Contributors

lvjianfeng avatar cavanlee avatar

Stargazers

Hao Liu avatar blackhairpin avatar MWCao avatar Dayonly avatar chenming avatar S.King avatar  avatar ricky avatar huang shan avatar 马兰帝王 avatar MohsinAli avatar HUGE_VALF avatar jaoye avatar Jianyun avatar  avatar Kenny avatar Orangutan avatar Summer avatar  avatar 把子肉 avatar  avatar

Watchers

MohsinAli avatar  avatar

llcalendar's Issues

添加特定日期标红

我感觉使用日历一般是要对特定日期做标记的,所以小改了下。
///要标红的日期数组 @property (nonatomic ,strong) NSArray *selectedDay;

[self.view addSubview:self.collectionView];
之前先对数组进行赋值
self.selectedDay = @[@"2016-08-12",@"2016-09-01",@"2016-08-17"];

   - (void)getDataDayModel:(NSDate *)date{
    .....
  if ([dayDate.yyyyMMddByLineWithDate isEqualToString:[NSDate date].yyyyMMddByLineWithDate])        {
                mon.isSelectedDay = YES;
            }
}

改为

   - (void)getDataDayModel:(NSDate *)date{
    .....
  if (self.selectedDay.count > 0) {

                for (int i = 0; i<self.selectedDay.count;i ++ ) {
                    if ([dayDate.yyyyMMddByLineWithDate isEqualToString:self.selectedDay[i]]) {
                        mon.isSelectedDay = YES;
                    }
                }
            }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.