How To Make The Device Vibrate Or Ring- An iOS Swift Tutorial
How To Make The Device Vibrate Or Ring- An iOS Swift Tutorial The iPhones have a built-in ability to alert users by creating some vibration or sound effects. You can trigger the vibration or sound effects by using SystemSound services. This is very useful in many cases while working on iOS Apps. in this tutorial, we'll learn how to trigger the vibration or sound effect on any particular action or button clicks. This is very easy to do and just takes one or 2 lines of code. In this tutorial, I'll just write the code that you need to add in your button's action or any other specific function to make the device vibrate or sound + vibrate both. We'll also see how to make the device vibrate more than once. So let's start.. Before anything, make sure to import AVFoundation. For Vibrate Only: If you only want to make the device quick vibrate, then this one line of code will do the trick: AudioServicesPlaySystemSound ( kSystemSoundID_Vibrate ) For Sound ...