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.
Selecting any option will automatically load the page