Coder Social home page Coder Social logo

hongdong / fscalendar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wenchaod/fscalendar

0.0 0.0 0.0 1.25 MB

A superiorly awesome iOS7+ calendar control, compatible with both Objective-C and Swift

License: MIT License

Objective-C 98.03% Ruby 0.24% Swift 1.74%

fscalendar's Introduction

logo

Travis Version Platform Swift2 compatible Carthage compatible

欢迎加入QQ群: 323861692

Table of contents

Screenshots

iPhone

fscalendar

iPad

fscalendar-ipad

Working with AutoLayout and Orientation

fscalendar-scope-orientation-autolayout

Hide placeholder dates

fscalendar-showsplaceholder

Scope gesture

scopegesture

FSCalendar doesn't change frame or the constraint by itself, see Adjusts frame dynamicly

Installation

CocoaPods:

  • For iOS8+: 👍
use_frameworks!
pod 'FSCalendar'
  • For iOS7+:
pod 'FSCalendar'
  • Alternatively to give it a test run, run the command:
pod try FSCalendar

Carthage:

  • For iOS8+
github "WenchaoD/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

Warning

FSCalendar doesn't change frame by itself, Please implement

  • For autoLayout
- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated
{
    _calendarHeightConstraint.constant = CGRectGetHeight(bounds);
    [self.view layoutIfNeeded];
}
  • For manual layout
- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated
{
    calendar.frame = (CGRect){calendar.frame.origin,bounds.size};
}

Roll with Interface Builder

fscalendar - ibdesignable

Advanced Usage

Support me via paypal


打赏支持

Communications

  • If you found a bug with certain steps to reproduce, open an issue.
  • If you need help about your code, use stackoverflow and tag fscalendar
  • If you want to contribute, submit a pull request. Make sure to follow Coding Guidelines for Cocoa

# Contact

If your made a beautiful calendar with this library in your app, please take a screen shot and @me in twitter. Your help really means a lot to me!
如果你用这个库完成了一个外观漂亮的日历,希望你能将这个漂亮的日历截图在微博中@我,十分感谢!

License

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

fscalendar's People

Contributors

hongdong avatar jklp avatar lucianocn avatar readmecritic avatar schaechtele avatar sochalewski avatar vendruscolo avatar wenchaod avatar yas375 avatar zjmdp 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.