Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created June 19, 2020 06:11
Show Gist options
  • Save SunXiaoShan/facf74a33d688b98f4eb5f9ecd2ebb0a to your computer and use it in GitHub Desktop.
Save SunXiaoShan/facf74a33d688b98f4eb5f9ecd2ebb0a to your computer and use it in GitHub Desktop.
- (void)setupGestureEvent {
UIPanGestureRecognizer *gesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
[self.view addGestureRecognizer:gesture];
[self roundViews];
}
- (void)roundViews {
self.view.layer.cornerRadius = 10;
self.view.clipsToBounds = YES;
}
- (void)panGesture:(UIPanGestureRecognizer *)recognizer {
[self moveViewWithGesture:recognizer];
if (recognizer.state != UIGestureRecognizerStateEnded) {
return;
}
//TODO: implement gesture function
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment