Created
June 19, 2020 06:11
-
-
Save SunXiaoShan/facf74a33d688b98f4eb5f9ecd2ebb0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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