How can I manually trigger a single click-like vibration like the ones that happen when using peek&pop, or application shortcuts?
This method is easy to implement and it works really well (I tried it myself)
import AudioToolbox
AudioServicesPlaySystemSound(1519) // Peek feedback
AudioServicesPlaySystemSound(1520) // Pop feedback
AudioServicesPlaySystemSound(1521) // Three pulses feedback
I hope this helps! :)
It seems that these guys have found a way to do it for iOS 9 for phones with Taptic Engine (including the iPhone 6S). http://unifiedsense.com/development/using-taptic-engine-on-ios.html I'm not sure if it applies to iOS 8 or any other phones. They've essentially retrieved the Taptic Engine interface from UIDevice and called actuateFeedback with an integer corresponding to Peek or Pop.
Unfortunately these apps would likely be rejected by the App Store, if that's your intention.
Related
I'm playing around with the audio features in iOS, and I'm looking at MPRemoteCommandCenter's changePlaybackRateCommand. I have enabled it, given it a target, and set its supportedPlaybackRates, but I don't see any related UI showing up in control center or the lock screen. And other commands I've set up, like skip forward, skip back, like, dislike, and bookmark, show up properly.
How does a user trigger a MPChangePlaybackRateCommand on iOS?
I face this problem and when I search I get other people face the same problem here
but I found something strange when I play podcast app in apple watch I found rate icon and I change the playrate from it
I think it's not work in iPhone (iPhone 6 iOS 11 ) but appear and work in another Apple devices in my case Apple watch
in iOS example here Apple not add MPChangePlaybackRateCommand like other commands that make me sure about it's bug in iOS
Iphone6s has taptic engine or not, can I use a public API called UIFeedbackGenerator to access it?
Haptic feedback engine have been introduced in iPhone7/7+ and you can use it via UIFeedbackGenerator, here's an example:
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.prepare()
generator.impactOccurred()
As for iPhone 6S/6S I've found kind of fallback, please try it and describe the experience if you do have the device:
import AudioToolbox
AudioServicesPlaySystemSound(1519) // Actuate `Peek` feedback (weak boom)
AudioServicesPlaySystemSound(1520) // Actuate `Pop` feedback (strong boom)
AudioServicesPlaySystemSound(1521) // Actuate `Nope` feedback (series of three weak booms)
I've tried to summarize everything I found with regards to the Haptic feedback here:
http://www.mikitamanko.com/blog/2017/01/29/haptic-feedback-with-uifeedbackgenerator/
iPhone 7 has a more precise, more flexible Taptic Engine than iPhone 6s — you can use the UIFeedbackGenerator class cluster to get at the richer vocabulary of haptic feedback signals that iPhone 7 supports, but these APIs have no effect on iPhone 6s (or other devices).
iPhone 6s still has a Taptic Engine, but it's not as capable as the newer one — it supports only the haptic signals associated with 3D Touch features. However, it is possible to use those in your app:
to build a standard Peek/Pop UI (haptics included) into your app, use standard views that already do it (like table and collection views), set peek/pop segues in your storyboard, and/or adopt the UIViewControllerPreviewing and UIViewControllerPreviewingDelegate protocols in your view controller. You can do this in iOS 9.
to provide peek/pop gesture support — including the accompanying haptic feedback — without a UI, or with your own custom UI, use the UIPreviewInteraction class and its delegate protocol. This part requires iOS 10.
For more info about peek/pop, 3D Touch, and haptics in general, see the WWDC16 session "A Peek at 3D Touch" and Apple's guide to Adopting 3D Touch on iPhone.
I'm trying to detect if an iPhone was moved (even a slight movement), and then if the device was moved, i want the iPhone to play a sound.
Im new to IOS programming, and I've looked through a bunch of apple documentations, and i found that i must use CoreMotion . But I'm not sure how to implement it, to what id like to do in my app.
I've also searched on google for some help (e.g. NSHipster...), but i couldn't fine anything that meets my needs.
can anyone assist?
Thank you.
It seems that you need the motion accelerometer in CMMotionManager.
https://developer.apple.com/library/ios/documentation/CoreMotion/Reference/CMMotionManager_Class/index.html#//apple_ref/occ/instm/CMMotionManager/accelerometerData
It seems you want to detect an iPhone shake. Apple has an article on the subject:
https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/motion_event_basics/motion_event_basics.html#//apple_ref/doc/uid/TP40009541-CH6-SW2
I am developing an iphone app for my internal purpose(dont want to put it on App Store).
I want Some functionality similar to built in VoiceOver Application in iPhone.
In my app, i want my app to be kept in background, and when user touches to any button,textfield or any UIElement, then my backgrounded app should be able to know the accessibility label of that element which was touched by User and then perform some action(similar to speech in voiceover). Is there any private apis available to get this detail. If it is possible for jailbroken, then still it is OK for me.
You should try to use IOHid framework to do this.
Look at this question, because it has the code how to do this:
iOS touch event notifications (private API)
Although, I am not sure this method is still applicable in iOS 7 (I believe it was discussed in iOS 6 timeframe).
can you trigger airplay mirroring with iOS 5 code?
I see in the API how you can stream. Just wonder if anyone knows how to turn on and off mirroring programmically in my app on iPad2 using iOS5, or if that even is possible.
I DO see how to physically turn it on via the dock at the bottom of the screen,
so no need to post a link to the Apple demo of that.
Thanks in advance
It's currently not possible. With a bit of luck this may change tomorrow, but it isn't something I can see apple doing. (for the same reasons as they dont allow toggling bluetooth/airplane mode/wifi etc..)