GithubHelp home page GithubHelp logo

veverka / calendarios7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leverdeterre/calendarios7

0.0 2.0 0.0 1.52 MB

Calendar component for iOS apps

License: MIT License

Ruby 0.90% Objective-C 98.63% C 0.48%

calendarios7's Introduction

Calendar iOS

Twitter License MIT CocoaPods

Calendar iOS is a very simple calendar/date picker component for your iOS apps based on UICollectionView and 2 layouts.

Day cells styles

Image

Changes


v 0.0.5

  • Support iphone 5, 6, 6Plus layout
  • Fixed Xcode 6
  • Fixed 64bits warnings

v 0.0.3

  • Fixed section number (number of months between two dates)
  • update app localization

v 0.0.2

  • Implementation of horizontal scrollDirection

v 0.0.1

  • Draft version

Supported iOS & SDK Versions

  • Earliest supported deployment target - iOS 6.0

Installation

pod 'CalendarIOS7'

Creating a CalendarViewController

    CALAgendaViewController *agendaVc = [CALAgendaViewController new];
    agendaVc.calendarScrollDirection = UICollectionViewScrollDirectionHorizontal;
    agendaVc.agendaDelegate = self;
    [agendaVc setFromDate:fromDate];
    [agendaVc setToDate:toDate];
    #Select cell style
    agendaVc.dayStyle = CALDayCollectionViewCellDayUIStyleIOS7;

Or subclassing CALAgendaViewController (don't forget your CollectionView outlet CALAgendaCollectionView)

    CALAgendaViewController *agendaVc = [CALAgendaViewController new];
    agendaVc.calendarScrollDirection = UICollectionViewScrollDirectionHorizontal;
    agendaVc.agendaDelegate = self;
    [agendaVc setFromDate:fromDate];
    [agendaVc setToDate:toDate];
    #Select cell style
    agendaVc.dayStyle = CALDayCollectionViewCellDayUIStyleIOS7;

Delegation : CALAgendaCollectionViewDelegate

- (void)agendaCollectionView:(CALAgendaCollectionView *)agendaCollectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath selectedDate:(NSDate *)selectedDate;
- (BOOL)agendaCollectionView:(CALAgendaCollectionView *)agendaCollectionView canSelectDate:(NSDate *)selectedDate;
- (void)agendaCollectionView:(CALAgendaCollectionView *)agendaCollectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath startDate:(NSDate *)startDate endDate:(NSDate*)endDate;

Other protocols : CALgendaEvent

If events are availble, cell can be customize to present this state. The calendar view controller can get a array of events. Events have just to implement this protocol.

@protocol CALgendaEvent <NSObject>

- (NSDate *)eventStartDate;
- (NSDate *)eventEndDate;
- (NSString *)eventName;

@end

TODOS

  • Improve genericity and customization of cells,
  • Hours selection is a draft version .. so i'have to finish it :)

calendarios7's People

Contributors

leverdeterre avatar arunaharsa avatar nuthinking avatar

Watchers

James Cloos avatar Elena avatar

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.