omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Seanz1207
    3. Posts

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by Seanz1207

    • Accessing the taptic engine

      After some research, I found a way to play the "peek" and "pop" taptic engine effects. This is tested on my iPhone 6s. See code below. Hope it helps.

      from objc_util import * 
      
      UIDevice = ObjCClass('UIDevice')
      
      def taptic_peek():
      	d = UIDevice.new()
      	t = d._tapticEngine()
      	t.actuateFeedback_(1001)   # or t.actuateFeedback_(0)
      	
      def taptic_pop():
      	d = UIDevice.new()
      	t = d._tapticEngine()
      	t.actuateFeedback_(1002)   # or t.actuateFeedback_(1)
      
      def taptic_triple_knock():
      	d = UIDevice.new()
      	t = d._tapticEngine()
      	t.actuateFeedback_(2)
      

      See here: http://stackoverflow.com/questions/32526868/taptic-in-ios-9

      Some update:

      On my iPhone 6s with iOS 10, actuateFeedback_(0) seems to give the same result as actuateFeedback_(1001), and actuateFeedback_(1) the same as actuateFeedback_(1002).
      Also, I found that actuateFeedback_(2) gives the quick triple knock you get when you flip the vibrate/ring switch. Code has been updated above.

      posted in Pythonista
      Seanz1207
      Seanz1207