Guest User

Untitled

a guest
Jan 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. @interface ViewController () <SWRevealViewControllerDelegate>
  2.  
  3. @property (strong, nonatomic) UIView* holderView;
  4.  
  5.  
  6. #pragma mark - SWRevealViewController
  7. - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position {
  8. if (position == FrontViewPositionRight) {
  9. self.holderView = [[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, self.view.bounds.size.width, self.view.bounds.size.height)];
  10. self.holderView.backgroundColor = [UIColor blackColor];
  11. self.holderView.alpha = 0;
  12. [self.view addSubview:self.holderView];
  13.  
  14. [UIView animateWithDuration:0.3 animations:^{
  15. self.holderView.alpha = 0.1;
  16. }];
  17.  
  18. }
  19. else if (position == FrontViewPositionLeft){
  20. [UIView animateWithDuration:0.3 animations:^{
  21. self.holderView.alpha = 0;
  22. [self.holderView removeFromSuperview];
  23. }];
  24. }
  25. }
Add Comment
Please, Sign In to add comment