Coder Social home page Coder Social logo

nalex87 / fscalendar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lixar/fscalendar

0.0 1.0 0.0 964 KB

A superiorly awesome iOS7+ calendar control, compatible with both Objective-c and Swift2

Home Page: https://www.cocoacontrols.com/controls/fscalendar

License: MIT License

Objective-C 97.50% Ruby 0.29% Swift 2.21%

fscalendar's Introduction

fscalendar

Version Platform Swift2 compatible Carthage compatible License

Screenshots

iPhone

fscalendar

iPad

fscalendar-ipad

Installation

Cocoapods:

  • For iOS8+: ๐Ÿ‘
use_frameworks!
pod 'FSCalendar'
  • For iOS7+:
pod 'FSCalendar'

Carthage:

  • For iOS8+
github "WenchaoIOS/FSCalendar"

Manually:

  • Drag all files under FSCalendar folder into your project. ๐Ÿ‘

Support IBInspectable / IBDesignable

Only the methods marked "๐Ÿ‘" support IBInspectable / IBDesignable feature. Have fun with Interface builder

Setup

Use Interface Builder

  1. Drag an UIView object to ViewController Scene
  2. Change the Custom Class to FSCalendar
  3. Link dataSource and delegate to the ViewController

fscalendar-ib

  1. Finally, you should implement FSCalendarDataSource and FSCalendarDelegate in ViewController.m

Or use code

@property (weak , nonatomic) FSCalendar *calendar;
// In loadView(Recommended) or viewDidLoad
FSCalendar *calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
calendar.dataSource = self;
calendar.delegate = self;
[self.view addSubview:calendar];
self.calendar = calendar;

Or swift

private weak var calendar: FSCalendar!
// In loadView or viewDidLoad
let calendar = FSCalendar(frame: CGRect(x: 0, y: 0, width: 320, height: 300))
calendar.dataSource = self
calendar.delegate = self
view.addSubview(calendar)
self.calendar = calendar

## Focus on selected date on ***week mode*** ![fscalendar-scope](https://cloud.githubusercontent.com/assets/5186464/12474251/aec94a32-c054-11e5-8b30-9e3d03d9a846.gif)

How to use

  • Use focusOnSingleSelectedDate, default is YES
calendar.focusOnSingleSelectedDate = YES;
  • Implement calendarCurrentScopeWillChange:animated:
- (void)calendarCurrentScopeWillChange:(FSCalendar *)calendar animated:(BOOL)animated
{
    CGFloat height = [calendar sizeThatFits:CGSizeZero].height;
    calendar.frame = CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame), self.view.bounds.size.width, height);
}
  • Try to change scope to week
[calendar setScope:FSCalendarScopeWeek animated:YES];
  • To change back
[calendar setScope:FSCalendarScopeMonth animated:YES];

Roll with Interface Builder

fscalendar - ibdesignable

More Usage

  • To view more usage, download the zip file and read the example.
  • Or your could refer to this document

If you like this repo

  • Star this repo.
  • Send your calendar screenshot or itunes link address here.

Support me via paypal

Contact

License

FSCalendar is available under the MIT license. See the LICENSE file for more info.

fscalendar's People

Contributors

wenchaod avatar jklp avatar lucianocn avatar zjmdp avatar

Watchers

Nikolaenko Aleksey 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.