Are you planning to create an app that will be used while swimming or doing water activities?

If so, you will need to lock the Apple Watch touch screen to prevent accidental taps while submerged.


The WatchKit framework provides a method to lock the screen programmatically, but only the user will be able to unlock it.

To use this feature you must call:



enableWaterLock() must be called from the main thread.


To be able to activate enableWaterLock() the app must be running on a supported device and the WKInterfaceDevice.current().waterResistanceRating must be wr50.

Additional features

To detect whether the screen is locked, Apple provides this property:



Now you can prevent accidental taps while your users are having fun in water!

I hope I helped you with you journey with watchOS development.

See you in the next guide.

What are you thoughts about this? Tweet me @franceleonidev and share your opinion.

Source link