In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you the "example analysis of vibration feedback and system vibration in iOS", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn "sample analysis of vibration feedback and system vibration in iOS".
Taptic Engine
First understand a concept-- Taptic Engine
Taptic Engine is a new vibration module introduced on Apple products, which first appeared in Apple Watch. Taptic Engine is also built-in in iPhone 6s and iPhone 6s Plus, and has been upgraded in design.
Taptic Engine vibration module provides Force Touch and 3D Touch for Apple Watch, iPhone 6s and iPhone 7. Different screen operations can feel different vibration tactile effects and bring a better user experience.
Vibration feedback (UIFeedbackGenerator)
Vibration feedback is a new feature after iOS 10, compared to the previous system vibration.
AudioServicesPlaySystemSound (kSystemSoundID_Vibrate)
It is much friendlier, there is no sound, the vibration amplitude is moderate, and there is no need to set the "ring mode vibration" on. This is also the feedback shock that Apple recommends developers to use.
The e.g. Switch control slides, the clock selects the time to slide, and the vibrations generated are all UIFeedbackGenerator characteristics.
Now the application of "vibration feedback" is very wide-drop-down refresh, click on important Button; selector, and so on. You can add feedback.
Apple document (UIFeedbackGenerator)
/ UIImpactFeedbackGenerator.h// UIKit//// Copyright ©2016 Apple Inc. All rights reserved.//#import NS_ASSUME_NONNULL_BEGINtypedef NS_ENUM (NSInteger, UIImpactFeedbackStyle) {UIImpactFeedbackStyleLight, UIImpactFeedbackStyleMedium, UIImpactFeedbackStyleHeavy}; / / UIImpactFeedbackGenerator is used to give user feedback when an impact between UI elements occursUIKIT_CLASS_AVAILABLE_IOS_ONLY (100.0) @ interface UIImpactFeedbackGenerator: UIFeedbackGenerator- (instancetype) initWithStyle: (UIImpactFeedbackStyle) style;/// call when your UI element impacts something else- (void) impactOccurred;@end
It's also easy to use vibration feedback:
UIImpactFeedbackGenerator * feedBackGenertor = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium]; [feedBackGenertor impactOccurred]
Note: "UIImpactFeedbackGenerator' is only available on iOS 10.0 or newer", add version restrictions when using it. **
Mobile phone-setting-sound and touch-system tactile feedback (on)
The system vibrated AudioServicesPlaySystemSound (kSystemSoundID_Vibrate) before that.
Before iOS 10, the system vibrate in the mode of vibration + ringtone, which now seems to be very unfriendly, first vibrating a little louder, then with sound, and the experience is not good. But this way you can customize the sound effects.
Apple document (AudioServicesPlaySystemSound)
# import AudioServicesPlaySystemSound (kSystemSoundID_Vibrate)
Note: mobile phone-setting-sound and touch-ring mode vibrate (on)
The above is all the contents of this article entitled "sample Analysis of Vibration feedback and system Vibration in iOS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.