0

I need some way to hide a toolbox as long as it is unused, so I was inspired by the iPad Paper app by 53.. When the user swipes down on the tool box, it slides down and out of screen, and when you swipe up from the bottom of the screen, it slides back up.

enter image description here

Could somebody please tell me how to create this function?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Anders
  • 160
  • 1
  • 1
  • 9

1 Answers1

1

Just add a swipe gesture recogniser and in viewDidLoad add this

UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeup:)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionUp)];
[[self view] addGestureRecognizer:recognizer];
[recognizer release];

UISwipeGestureRecognizer *recognizer1 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeDown:)];
[recognizer1 setDirection:(UISwipeGestureRecognizerDirectionDown)];
[[self view] addGestureRecognizer:recognizer1];
[recognizer1 release];

and implement those selectors to view and dismiss your view controller which has your toolbox.. use this link for making your view controller of custom size How to present a modal view controller with custom size in center?

Community
  • 1
  • 1
Agent Chocks.
  • 1,312
  • 8
  • 19