Skip to content

Commit 5ae4eb2

Browse files
Alfredo UribeAlfredo Uribe
authored andcommitted
added user interaction toggle for page controller
turned on when new item button is shown and off when button is hidden
1 parent 497cea1 commit 5ae4eb2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

EasyReader/Application/Controls/CSCollectionPageControl.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ - (id)initWithCoder:(NSCoder *)aDecoder
3737
self = [super initWithCoder:aDecoder];
3838

3939
if (self) {
40+
4041
button_newItem = [[UIButton alloc] init];
4142
button_newItem.alpha = 0.0f;
4243
[button_newItem setTitle:@"Jump to first item" forState:UIControlStateNormal];
4344
[button_newItem.titleLabel setFont:[UIFont fontWithName:@"HelveticaNeue-Medium" size:12.0f]];
4445
[button_newItem.titleLabel setTextAlignment:NSTextAlignmentCenter];
4546
button_newItem.userInteractionEnabled = YES;
46-
self.userInteractionEnabled = YES;
47+
self.userInteractionEnabled = NO;
4748

4849
[button_newItem addTarget:self action:@selector(newItemButton:) forControlEvents:UIControlEventTouchUpInside];
4950

@@ -60,7 +61,6 @@ -(void)layoutSubviews
6061
{
6162
[super layoutSubviews];
6263

63-
6464
CGRect buttonFrame = CGRectMake(CGRectGetWidth(self.frame)/2.0-50,(CGRectGetHeight(self.frame)/2)-15, 100, 30);
6565
[button_newItem setFrame:buttonFrame];
6666

@@ -220,6 +220,7 @@ - (void)fadeInSubviews
220220
*/
221221
- (void) hideNewItemButton
222222
{
223+
[self setUserInteractionEnabled:NO];
223224
[UIView animateWithDuration:.25 animations:^{
224225
[button_newItem setAlpha:0];
225226
}];
@@ -230,6 +231,7 @@ - (void) hideNewItemButton
230231
*/
231232
- (void) showNewItemButton
232233
{
234+
[self setUserInteractionEnabled:YES];
233235
[UIView animateWithDuration:.25 animations:^{
234236
[button_newItem setAlpha:.35f];
235237
}];

0 commit comments

Comments
 (0)