57 lines
1.3 KiB
Objective-C
57 lines
1.3 KiB
Objective-C
//
|
|
// FullScreenExample.m
|
|
// FSCalendar
|
|
//
|
|
// Created by Wenchao Ding on 9/16/15.
|
|
// Copyright (c) 2015 wenchaoios. All rights reserved.
|
|
//
|
|
|
|
#import "FullScreenExampleViewController.h"
|
|
#import "NSDate+FSExtension.h"
|
|
|
|
#import "FSCalendarTestMacros.h"
|
|
|
|
@implementation FullScreenExampleViewController
|
|
|
|
- (instancetype)init
|
|
{
|
|
self = [super init];
|
|
if (self) {
|
|
self.title = @"FSCalendar";
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)loadView
|
|
{
|
|
UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
view.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1.0];
|
|
self.view = view;
|
|
|
|
FSCalendar *calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height)];
|
|
calendar.dataSource = self;
|
|
calendar.delegate = self;
|
|
calendar.pagingEnabled = NO; // important
|
|
calendar.allowsMultipleSelection = YES;
|
|
calendar.backgroundColor = [UIColor whiteColor];
|
|
[self.view addSubview:calendar];
|
|
self.calendar = calendar;
|
|
}
|
|
|
|
- (void)viewDidLoad
|
|
{
|
|
[super viewDidLoad];
|
|
|
|
#if 0
|
|
FSCalendarTestSelectDate
|
|
#endif
|
|
|
|
}
|
|
|
|
- (void)calendarCurrentPageDidChange:(FSCalendar *)calendar
|
|
{
|
|
NSLog(@"did change page %@",[calendar.currentPage fs_stringWithFormat:@"yyyy-MM"]);
|
|
}
|
|
|
|
@end
|