Skip to content

Commit

Permalink
fixed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ocrickard committed Mar 31, 2012
1 parent e3e907a commit 5384521
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Drag the following files into your project:

Then implement the OCCalendarDelegate protocol in the class you wish to call from. The only method in this protocol specifies a way for the calendar to report back the beginning and ending ranges of dates. These are returnes as NSDate objects for convenience. In the demo app, we do the following:

`- (void)completedWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate {
` - (void)completedWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate {
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateStyle:NSDateFormatterShortStyle];

Expand All @@ -30,18 +30,18 @@ Then implement the OCCalendarDelegate protocol in the class you wish to call fro
calVC.delegate = nil;
[calVC release];
calVC = nil;
}`
} `

Now, you should be able to show the calendar by alloc'ing and init'ing it, then adding to your view.

`//Here's where the magic happens
` //Here's where the magic happens
calVC = [[OCCalendarViewController alloc] initAtPoint:CGPointMake(150, 50) inView:self.view];
calVC.delegate = self;
[self.view addSubview:calVC.view];`
[self.view addSubview:calVC.view]; `

##Customization##
You can customize the look and feel of the controller by tweaking the CoreGraphics rendering code. I realize that this is not very pretty at the moment, but I'll eventually refactor it to make sure it's all neat and tidy. You can change the placement of the little arrow to either the right or left side of the popover by changing the "arrowPosition" int.

`arrowPosition = -1 // This is for arrow-left
arrowPosition = 0 // Arrow is centered
arrowPosition = 1 // Arrow is on the right
arrowPosition = 1 // Arrow is on the right `

0 comments on commit 5384521

Please sign in to comment.