Post

Replies

Boosts

Views

Activity

IOS16 UIPanGestureRecognizer
This function works fine in iOS 15 but not in iOS 16. In iOS 16 even though you drag your finger only adds or subtracts once. With 0.01 and 0.02 does not work but with 0.03 it does. @objc func pan(recognizer: UIPanGestureRecognizer) { if recognizer.state == UIGestureRecognizer.State.changed || recognizer.state == UIGestureRecognizer.State.ended { let velocity:CGPoint = recognizer.velocity(in: self.view) if velocity.y > 0 { UIScreen.main.brightness -= 0.01 } else { UIScreen.main.brightness += 0.01 } } } Thank you very much for your reply.
4
0
580
Oct ’22
IOS16 UIPanGestureRecognizer
This function works fine in iOS 15 but not in iOS 16. In iOS 16 even though you drag your finger only adds or subtracts once. With 0.01 and 0.02 does not work but with 0.03 it does. @objc func pan(recognizer: UIPanGestureRecognizer) { if recognizer.state == UIGestureRecognizer.State.changed || recognizer.state == UIGestureRecognizer.State.ended { let velocity:CGPoint = recognizer.velocity(in: self.view) if velocity.y > 0 { UIScreen.main.brightness -= 0.01 } else { UIScreen.main.brightness += 0.01 } } } Thank you very much for your reply.
Replies
4
Boosts
0
Views
580
Activity
Oct ’22