Permalink
Browse files

Merge pull request #174 from nakanomi/master

Bug Fix for Calendar Month Grid with touch points.
  • Loading branch information...
2 parents 2b17f5d + d1255bf commit 40952049fc92268edebee94fffbe58daabf60f8e Devin Ross committed Mar 20, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/TapkuLibrary/TKCalendarMonthView.m
@@ -477,6 +477,14 @@ - (NSDate*) dateSelected{
- (void) reactToTouch:(UITouch*)touch down:(BOOL)down{
CGPoint p = [touch locationInView:self];
+ /*
+ When a UIViewController allocated and pushViewController it in delegate.- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)date.
+ p.x is over self.bounds.size.width(a cause -- unknown).
+ And column becomes 7 or more.
+ It is if it is the 4th [ or more ] row, App will crash (e.g. select 2012/07/29).
+ So I added check range of p.x.
+ */
+ if(p.x > self.bounds.size.width || p.x < 0) return;
if(p.y > self.bounds.size.height || p.y < 0) return;
NSInteger column = p.x / 46, row = p.y / 44;

0 comments on commit 4095204

Please sign in to comment.