Version Bump |
||
|---|---|---|
| Example | ||
| FSCalendar | ||
| SwiftExample | ||
| .gitignore | ||
| FSCalendar.podspec | ||
| LICENSE | ||
| MOREUSAGE.md | ||
| README.md | ||
README.md
Screenshots
iPhone
iPad
Installation
CocoaPods:
- For iOS8+: 👍
use_frameworks!
pod 'FSCalendar'
- For iOS7+:
pod 'FSCalendar'
Carthage:
- For iOS8+
github "WenchaoIOS/FSCalendar"
Manually:
- Drag all files under
FSCalendarfolder into your project. 👍
Support IBInspectable / IBDesignable
Only the methods marked "👍" support IBInspectable / IBDesignable feature. Have fun with Interface builder
Setup
Use Interface Builder
- Drag an UIView object to ViewController Scene
- Change the
Custom ClasstoFSCalendar - Link
dataSourceanddelegateto the ViewController
- Finally, you should implement
FSCalendarDataSourceandFSCalendarDelegatein 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
- To use
FSCalendarin swift, you need to Create Bridge Header first.
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*** 
How to use
- Use
focusOnSingleSelectedDate, default isYES
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
scopetoweek
[calendar setScope:FSCalendarScopeWeek animated:YES];
- To change back
[calendar setScope:FSCalendarScopeMonth animated:YES];
Roll with Interface Builder
More Usage
- To view more usage, download the zip file and read the example.
- Or you could refer to this document
If you like this repo
- Star this repo.
- Send your calendar screenshot or
itunes link addresshere.
Support me via 
Contact
- Email:
f33chobits@gmail.com
License
FSCalendar is available under the MIT license. See the LICENSE file for more info.




