Skip to content

Commit

Permalink
Show accessory view once focus animation is done.
Browse files Browse the repository at this point in the history
  • Loading branch information
autresphere committed Mar 5, 2014
1 parent 9967762 commit 3ff15c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
1 change: 1 addition & 0 deletions ASMediaFocusManager/ASMediaFocusController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
- (void)installZoomView;
- (void)uninstallZoomView;
- (void)pinAccessoryView;
- (void)showAccessoryView:(BOOL)visible;

@end
15 changes: 3 additions & 12 deletions ASMediaFocusManager/ASMediaFocusController.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ - (void)viewDidLoad
self.titleLabel.layer.shadowOpacity = 1;
self.titleLabel.layer.shadowOffset = CGSizeZero;
self.titleLabel.layer.shadowRadius = 1;
self.accessoryView.alpha = 0;
}

- (void)viewDidUnload
Expand All @@ -58,16 +59,6 @@ - (void)viewWillDisappear:(BOOL)animated
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
}

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.titleLabel.alpha = 0;
[UIView animateWithDuration:0.5
animations:^{
self.titleLabel.alpha = 1;
}];
}

- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
Expand Down Expand Up @@ -212,7 +203,7 @@ - (void)pinAccessoryView
[self pinAccessoryView:self.accessoryView];
}

- (void)showAccessoryViews:(BOOL)visible
- (void)showAccessoryView:(BOOL)visible
{
if(visible == [self accessoryViewsVisible])
return;
Expand Down Expand Up @@ -273,7 +264,7 @@ - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView

- (void)scrollViewDidZoom:(UIScrollView *)scrollView
{
[self showAccessoryViews:self.scrollView.zoomScale == self.scrollView.minimumZoomScale];
[self showAccessoryView:self.scrollView.zoomScale == self.scrollView.minimumZoomScale];
}

#pragma mark - Notifications
Expand Down
7 changes: 1 addition & 6 deletions ASMediaFocusManager/ASMediaFocusManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,6 @@ - (void)setupAccessoryViewOnFocusViewController:(ASMediaFocusController *)focusV
doneButton.center = CGPointMake(focusViewController.accessoryView.bounds.size.width - doneButton.bounds.size.width/2 - 10, doneButton.bounds.size.height/2 + 10);
doneButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
[focusViewController.accessoryView addSubview:doneButton];

doneButton.alpha = 0;
[UIView animateWithDuration:0.5
animations:^{
doneButton.alpha = 1;
}];
}

#pragma mark - Gestures
Expand Down Expand Up @@ -321,6 +315,7 @@ - (void)handleFocusGesture:(UIGestureRecognizer *)gesture
}
completion:^(BOOL finished) {
[self installZoomView];
[self.focusViewController showAccessoryView:YES];
self.isZooming = NO;

if (self.delegate && [self.delegate respondsToSelector:@selector(mediaFocusManagerDidAppear:)])
Expand Down

0 comments on commit 3ff15c6

Please sign in to comment.