Skip to content

Commit

Permalink
fix sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0c committed Oct 12, 2014
1 parent ef0162b commit ec72446
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Example/RDImageViewerController/RDViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,16 @@ - (IBAction)showViewController:(id)sender
if (reusedView == nil) {
UIView *view = [[UIView alloc] initWithFrame:frame];
UILabel *label = [[UILabel alloc] initWithFrame:frame];
label.text = [NSString stringWithFormat:@"%ld", (long)pageIndex];
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont systemFontOfSize:50];
label.tag = 100;
[view addSubview:label];
view.backgroundColor = [UIColor whiteColor];
reusedView = view;
}
else {
UILabel *label = (UILabel *)[reusedView viewWithTag:100];
label.text = [NSString stringWithFormat:@"%ld", (long)pageIndex];
}

UILabel *label = (UILabel *)[reusedView viewWithTag:100];
label.text = [NSString stringWithFormat:@"%ld", (long)pageIndex];

return reusedView;
} reuseIdentifier:^NSString *(NSInteger pageIndex) {
Expand Down Expand Up @@ -154,18 +152,16 @@ - (IBAction)showImageAndView:(id)sender
if (reusedView == nil) {
UIView *view = [[UIView alloc] initWithFrame:frame];
UILabel *label = [[UILabel alloc] initWithFrame:frame];
label.text = [NSString stringWithFormat:@"%ld", (long)pageIndex];
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont systemFontOfSize:50];
label.tag = 100;
[view addSubview:label];
view.backgroundColor = [UIColor whiteColor];
reusedView = view;
}
else {
UILabel *label = (UILabel *)[reusedView viewWithTag:100];
label.text = [NSString stringWithFormat:@"%ld", (long)pageIndex];
}

UILabel *label = (UILabel *)[reusedView viewWithTag:100];
label.text = [NSString stringWithFormat:@"%ld", (long)pageIndex];

return reusedView;
}];
Expand Down

0 comments on commit ec72446

Please sign in to comment.