0

I just saw that WKExtension.shared.EnableWaterLock is now deprecated. I used this method in my workout apps to prevent accidentally tapping the screen and ending the workout etc. Has it been replaced with any other method of locking the screen?

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
GarySabo
  • 5,806
  • 5
  • 49
  • 124
  • How would you accidentally end a workout when you need a swipe in a specific direction and a tap on a specific button? If you actually want to use it for its intended purpose, starting a swimming workout automatically puts on the water lock. – Dávid Pásztor Oct 08 '19 at 15:54
  • As my users can tell you @DávidPásztor it happens and this method has proven useful to prevent for the past 2 years – GarySabo Oct 08 '19 at 15:57

1 Answers1

6

That method wasn't removed from WatchKit, it was just moved from WKExtension to WKInterfaceDevice in watchOS 6.1. See WKInterfaceDevice.enableWaterLock().

You can call it using WKInterfaceDevice.current().enableWaterLock().

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116