{"id":1257,"date":"2018-06-05T13:35:35","date_gmt":"2018-06-05T13:35:35","guid":{"rendered":"http:\/\/sezeromer.com\/?p=1257"},"modified":"2023-02-26T23:43:14","modified_gmt":"2023-02-26T20:43:14","slug":"swift-titresim","status":"publish","type":"post","link":"https:\/\/sezeromer.com\/en\/swift-titresim\/","title":{"rendered":"Swift Vibration"},"content":{"rendered":"<p>In some projects, you can enjoy the vibrations of the phone. With vibration, we can get the attention of the user, we can report something important. It may be that you lost the game while playing the game, or a message came from somewhere. We can use vibration to give news. In <strong>Swift<\/strong> we will have to write a framework and one line of code to shake the phone.<\/p>\n<p>We are on the project we launched. We will add a framework to the Link Binary With Libraries section under <strong>Build Phases<\/strong> under Project properties. We will add the framework: <strong>AudioToolbox.framework<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1258\" src=\"http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/05\/swift-titresim.png\" sizes=\"(max-width: 1440px) 100vw, 1440px\" srcset=\"http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/05\/swift-titresim.png 1440w, http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/05\/swift-titresim-300x180.png 300w, http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/05\/swift-titresim-768x460.png 768w, http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/05\/swift-titresim-1024x613.png 1024w\" alt=\"\" width=\"1440\" height=\"862\" \/><\/p>\n<p>After adding the framework, we need to go to my .swift file and import the <strong>Framewok<\/strong> we have added to this file. Once you have signed up, you can <strong>vibrate<\/strong> the phone with the code block below.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))<\/pre>\n<\/div>\n<p>If you have any questions, you can reach us by email or comment.<\/p>","protected":false},"excerpt":{"rendered":"<p>In some projects, you can enjoy the vibrations of the phone. With vibration, we can get the attention of the user, we can report something important. It may be that you lost the game while playing the game, or a message came from somewhere. We can use vibration to give news. In Swift we will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1260,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[327],"tags":[478,482,480,115,484,481,476,477,328,475,479,485,483],"class_list":["post-1257","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift","tag-audio","tag-binary","tag-framewrok","tag-ios","tag-libraries","tag-link","tag-mobile","tag-prgramming","tag-swift","tag-titresim","tag-toolbox","tag-vibration","tag-with"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1257"}],"collection":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/comments?post=1257"}],"version-history":[{"count":4,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1257\/revisions"}],"predecessor-version":[{"id":2593,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1257\/revisions\/2593"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media\/1260"}],"wp:attachment":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media?parent=1257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/categories?post=1257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/tags?post=1257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}