ios - How do I detect my iPhone tilting upwards? -


i'm trying print statement when coremotion detects when iphone tilts upwards. can't seem figure out how make work. have right now:

if manager.isdevicemotionavailable { manager.devicemotionupdateinterval = 0.01 manager.startdevicemotionupdates(to: queue) {     [weak self] (data: cmdevicemotion?, error: error?) in     print("tilted!!")     }   } } 

tilted!! not being printed don't know if there's wrong code when tilt phone , it's not working. thanks!


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -