Skip to content

Commit

Permalink
Change allowsLongPressYearChange to allowsLongPressMonthChange.
Browse files Browse the repository at this point in the history
  • Loading branch information
kovpas committed Jul 21, 2012
1 parent 31f976a commit 7cc0d58
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions PMCalendar/src/PMCalendarController.h
Expand Up @@ -91,10 +91,10 @@

/**
* If set to YES, the calendar allows to long press on a month change arrow
* in order to iterate through years.
* in order to fast iterate through months.
* If set to NO, long press does nothing.
*/
@property (nonatomic, assign) BOOL allowsLongPressYearChange;
@property (nonatomic, assign) BOOL allowsLongPressMonthChange;

/**
* Returns the direction the arrow is pointing on a presented calendar.
Expand Down
12 changes: 6 additions & 6 deletions PMCalendar/src/PMCalendarController.m
Expand Up @@ -45,7 +45,7 @@ @implementation PMCalendarController
@dynamic allowedPeriod;
@dynamic mondayFirstDayOfWeek;
@dynamic allowsPeriodSelection;
@dynamic allowsLongPressYearChange;
@dynamic allowsLongPressMonthChange;

@synthesize calendarArrowDirection = _calendarArrowDirection;
@synthesize currentOrientation = _currentOrientation;
Expand Down Expand Up @@ -96,7 +96,7 @@ - (void) initializeWithSize:(CGSize) size
[self.mainView addSubview:self.calendarView];

self.allowsPeriodSelection = YES;
self.allowsLongPressYearChange = YES;
self.allowsLongPressMonthChange = YES;
}

- (id) initWithSize:(CGSize) size
Expand Down Expand Up @@ -401,14 +401,14 @@ - (void)setAllowsPeriodSelection:(BOOL)allowsPeriodSelection
self.digitsView.allowsPeriodSelection = allowsPeriodSelection;
}

- (BOOL)allowsLongPressYearChange
- (BOOL)allowsLongPressMonthChange
{
return self.digitsView.allowsLongPressYearChange;
return self.digitsView.allowsLongPressMonthChange;
}

- (void)setAllowsLongPressYearChange:(BOOL)allowsLongPressYearChange
- (void)setAllowsLongPressMonthChange:(BOOL)allowsLongPressMonthChange
{
self.digitsView.allowsLongPressYearChange = allowsLongPressYearChange;
self.digitsView.allowsLongPressMonthChange = allowsLongPressMonthChange;
}

- (PMPeriod *) period
Expand Down
2 changes: 1 addition & 1 deletion PMCalendar/src/PMCalendarView.h
Expand Up @@ -42,7 +42,7 @@
/**
* Is long press allowed. See PMCalendarController for more information.
*/
@property (nonatomic, assign) BOOL allowsLongPressYearChange;
@property (nonatomic, assign) BOOL allowsLongPressMonthChange;
@property (nonatomic, assign) id<PMCalendarViewDelegate> delegate;

@end
Expand Down
8 changes: 4 additions & 4 deletions PMCalendar/src/PMCalendarView.m
Expand Up @@ -67,7 +67,7 @@ @implementation PMCalendarView
@synthesize daysView = _daysView;
@synthesize selectionView = _selectionView;
@synthesize allowsPeriodSelection = _allowsPeriodSelection;
@synthesize allowsLongPressYearChange = _allowsLongPressYearChange;
@synthesize allowsLongPressMonthChange = _allowsLongPressMonthChange;

- (void)dealloc
{
Expand Down Expand Up @@ -95,7 +95,7 @@ - (id)initWithFrame:(CGRect)frame
self.panGestureRecognizer.delegate = self;
[self addGestureRecognizer:self.panGestureRecognizer];

self.allowsLongPressYearChange = YES;
self.allowsLongPressMonthChange = YES;

self.selectionView = [[PMSelectionView alloc] initWithFrame:CGRectInset(self.bounds, -innerPadding.width, -innerPadding.height)];
[self addSubview:self.selectionView];
Expand Down Expand Up @@ -546,9 +546,9 @@ - (void) longPressHandling: (UIGestureRecognizer *)recognizer
}
}

- (void)setAllowsLongPressYearChange:(BOOL)allowsLongPressYearChange
- (void)setAllowsLongPressMonthChange:(BOOL)allowsLongPressMonthChange
{
if (!allowsLongPressYearChange)
if (!allowsLongPressMonthChange)
{
if (self.longPressGestureRecognizer)
{
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -126,10 +126,10 @@ Implemented properties
@property (nonatomic, assign) BOOL allowsPeriodSelection;
```

**If YES, user can long press on arrow to iterate through years (single tap iterates through months)**
**If YES, user can long press on arrow to fast iterate through months**

``` objective-c
@property (nonatomic, assign) BOOL allowsLongPressYearChange;
@property (nonatomic, assign) BOOL allowsLongPressMonthChange;
```

**Direction of the arrow (similar to UIPopoverController's arrowDirection)**
Expand Down

0 comments on commit 7cc0d58

Please sign in to comment.