Skip to content

Commit

Permalink
Implement detection LongPress
Browse files Browse the repository at this point in the history
  • Loading branch information
Husseinhj committed Nov 21, 2017
1 parent 5ead954 commit d7a2442
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ios_calendar/Sources/CalendarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ @interface CalendarView ()

CGRect yearTitleRect;
CGRect monthTitleRect;

// Range selection properties
NSInteger startRangeDay;
NSInteger startRangeMonth;
NSInteger startRangeYear;
CalendarViewRect *startRangeDayRect;
NSDate *startDate;

NSInteger endRangeDay;
NSInteger endRangeMonth;
NSInteger endRangeYear;
CalendarViewRect *endRangeDayRect;
NSDate *endDate;
}

@property (nonatomic, strong) NSCalendarIdentifier calendarId;
Expand Down Expand Up @@ -216,6 +229,13 @@ - (void) initProperties{
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)];
doubleTap.numberOfTapsRequired = 2;
[self addGestureRecognizer:doubleTap];

UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self
action:@selector(longPress:)];
// longPress.numberOfTapsRequired = 1;
longPress.numberOfTouchesRequired = 1;
longPress.minimumPressDuration = 0.2f;
[self addGestureRecognizer:longPress];
}

- (void)setup
Expand Down

0 comments on commit d7a2442

Please sign in to comment.