-
Notifications
You must be signed in to change notification settings - Fork 3
/
CalendarViewController.m
executable file
·60 lines (44 loc) · 1.48 KB
/
CalendarViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Created by yaonphy on 12-11-13.
// Copyright (c) 2012年 yang. All rights reserved.
#import "CalendarViewController.h"
#import "VRGCalendarView.h"
@interface CalendarViewController ()
{
VRGCalendarView *_theCalendar;
}
@end
@implementation CalendarViewController
- (void)viewDidLoad
{
// [super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self initNavItem];
self.navigationItem.title = @"iWordsCalendar";
_theCalendar = [VRGCalendarView sharedCalendar];
_theCalendar.delegate=self;
_theCalendar.frame = CGRectMake(0, 40, 320,350);
[self.view addSubview:_theCalendar];
}
-(void)dealloc
{
[super dealloc];
}
-(void)calendarView:(VRGCalendarView *)calendarView switchedToMonth:(int)month targetHeight:(float)targetHeight animated:(BOOL)animated {
if (month==[[NSDate date] month]) {
NSArray *dates = [NSArray arrayWithObjects:[NSNumber numberWithInt:1],[NSNumber numberWithInt:5], nil];
[calendarView markDates:dates];
}
}
-(void)calendarView:(VRGCalendarView *)calendarView dateSelected:(NSDate *)date {
NSLog(@"Selected date = %@",date);
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
@end