{"id":1164,"date":"2018-04-24T08:20:37","date_gmt":"2018-04-24T08:20:37","guid":{"rendered":"http:\/\/sezeromer.com\/?p=1164"},"modified":"2023-02-26T14:01:26","modified_gmt":"2023-02-26T11:01:26","slug":"swift-activity-indicator","status":"publish","type":"post","link":"https:\/\/sezeromer.com\/en\/swift-activity-indicator\/","title":{"rendered":"Edit Swift Activity Indicator"},"content":{"rendered":"<p><strong>Activity Indicator<\/strong> usage is generally important. When we do something on the backplane, it is necessary to let the user know that something is behind. For this, a rotating circular object appears on the screen. We call it Activty Indicator. I have already mentioned how it was used for <strong>Xamarin<\/strong> from my earlier writings. In this article I will indicate how to use <strong>Swift<\/strong>. It will be a simple article.<\/p>\n<p>First we will have to upload the file with the .storyboard extension in our progeny and assign it to view. We need to assign<strong> Activity Indicator<\/strong> to this page. After that, we can easily change the size and color of this property from side to side. After making these adjustments, I throw a button on the screen separately. The scenario will stop if the activity indicator is not running, or if it is running. Our design part looks like below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1165\" src=\"http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/04\/indicator-1.png\" sizes=\"(max-width: 1400px) 100vw, 1400px\" srcset=\"http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/04\/indicator-1.png 1400w, http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/04\/indicator-1-300x171.png 300w, http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/04\/indicator-1-768x439.png 768w, http:\/\/sezeromer.com\/wp-content\/uploads\/2018\/04\/indicator-1-1024x585.png 1024w\" alt=\"\" width=\"1400\" height=\"800\" \/><\/p>\n<p>Now let&#8217;s get to the code part. We need to create an outlet for Activity Indicator. In this way, we will be able to access the activity indicator and stop it. In addition to that, we create an action for the button. With this button we will stop and start. We use a variable to control whether the system works. We start and stop the Activity Indicator with the startAnimating () and stopAnimaitng () functions. We are also checking if it works with else.<\/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;}\">@IBAction func Baslat(_ sender: Any) {\r\n        if sayi == 0 {\r\n            yuklemeImleci.startAnimating()\r\n            sayi=1\r\n        }\r\n        else\r\n        {\r\n            \r\n            yuklemeImleci.stopAnimating()\r\n            sayi=0\r\n        }\r\n        \r\n    }<\/pre>\n<\/div>\n<p>If you have any questions, you can reach us by email or comment.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Activity Indicator usage is generally important. When we do something on the backplane, it is necessary to let the user know that something is behind. For this, a rotating circular object appears on the screen. We call it Activty Indicator. I have already mentioned how it was used for Xamarin from my earlier writings. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1200,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[327],"tags":[416,417,312,115,328,418,392],"class_list":["post-1164","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift","tag-activity","tag-background","tag-indicator","tag-ios","tag-swift","tag-task","tag-yukleme"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1164"}],"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=1164"}],"version-history":[{"count":4,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1164\/revisions"}],"predecessor-version":[{"id":2588,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1164\/revisions\/2588"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media\/1200"}],"wp:attachment":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media?parent=1164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/categories?post=1164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/tags?post=1164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}