<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7653192557512741265</id><updated>2026-09-28T22:23:29.647+05:30</updated><title type='text'>Suraj Ramjan Mirajkar</title><subtitle type='html'>Blog for app developers. iOS, iPadOS, watchOS, Objective C, Swift, SwiftUI.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-3134929533141318471</id><published>2025-05-01T20:08:00.003+05:30</published><updated>2025-05-02T12:29:45.756+05:30</updated><title type='text'>AsyncImage - SwiftUI</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;code data-end=&quot;12&quot; data-start=&quot;0&quot;&gt;&lt;b&gt;AsyncImage&lt;/b&gt;&lt;/code&gt; is a built-in SwiftUI view introduced in &lt;span data-end=&quot;65&quot; data-start=&quot;54&quot;&gt;&lt;b&gt;iOS 15+&lt;/b&gt;&lt;/span&gt; to asynchronously load and display images from a&lt;span data-end=&quot;133&quot; data-start=&quot;119&quot;&gt;&amp;nbsp;URL&lt;/span&gt;.&amp;nbsp;&lt;/p&gt;&lt;p&gt;It provides a simple way to load images &lt;span data-end=&quot;227&quot; data-start=&quot;185&quot;&gt;without writing URLSession code to download data in background and set it to ImageView on Main thread&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt; SwiftUI&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px; min-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p3&quot; style=&quot;background-color: #1f1f24; color: #5dd8ff; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;struct&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt; &lt;/span&gt;AsyncImageView&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;var&lt;/b&gt;&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;images&lt;/span&gt;: [&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;] = [&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1000/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1001/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1002/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1003/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1004/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1005/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1006/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1007/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1008/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;: &lt;/span&gt;&quot;https://picsum.photos/id/1009/400/400&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)!&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;]&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;var&lt;/b&gt;&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;some&lt;/b&gt;&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;View&lt;/span&gt; {&lt;/p&gt;&lt;p class=&quot;p5&quot; style=&quot;background-color: #1f1f24; color: #d0a8ff; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;NavigationView&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;List&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #d0bf69;&quot;&gt;0&lt;/span&gt;..&amp;lt;&lt;span class=&quot;s7&quot; style=&quot;color: #67b7a4;&quot;&gt;images&lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;count&lt;/span&gt;, &lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;id&lt;/span&gt;: \.&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;self&lt;/b&gt;&lt;/span&gt;) { index &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;in&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;AsyncImage&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;url&lt;/span&gt;: &lt;span class=&quot;s7&quot; style=&quot;color: #67b7a4;&quot;&gt;images&lt;/span&gt;[index]) { phase &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;in&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;let&lt;/b&gt;&lt;/span&gt; image = phase.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;image&lt;/span&gt; {&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;image&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;resizable&lt;/span&gt;()&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;aspectRatio&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;contentMode&lt;/span&gt;: .&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;fill&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;let&lt;/b&gt;&lt;/span&gt; _ = &lt;span class=&quot;s7&quot; style=&quot;color: #67b7a4;&quot;&gt;setStringBox&lt;/span&gt;()&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;let&lt;/b&gt;&lt;/span&gt; _ = &lt;span class=&quot;s7&quot; style=&quot;color: #67b7a4;&quot;&gt;setIntBox&lt;/span&gt;()&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;} &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; phase.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;error&lt;/span&gt; != &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;nil&lt;/b&gt;&lt;/span&gt; {&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s8&quot; style=&quot;color: #fc6a5d;&quot;&gt;&quot;No image available&quot;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;} &lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/span&gt; {&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;Image&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;systemName&lt;/span&gt;: &lt;span class=&quot;s8&quot; style=&quot;color: #fc6a5d;&quot;&gt;&quot;photo&quot;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;frame&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;maxWidth&lt;/span&gt;: .&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;infinity&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;border&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;Color&lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;gray&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;padding&lt;/span&gt;()&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/p&gt;&lt;p class=&quot;p4&quot; style=&quot;background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #a167e6;&quot;&gt;navigationTitle&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;(&lt;/span&gt;&quot;Async Image SwiftUI&quot;&lt;span class=&quot;s2&quot; style=&quot;color: rgba(255, 255, 255, 0.85);&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;}&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px; min-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px; min-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p3&quot; style=&quot;background-color: #1f1f24; color: #5dd8ff; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #fc5fa3;&quot;&gt;&lt;b&gt;struct&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt; &lt;/span&gt;AsyncImageView_Previews&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;PreviewProvider&lt;/span&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p6&quot; style=&quot;background-color: #1f1f24; color: #fc5fa3; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;b&gt;static&lt;/b&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt; &lt;/span&gt;&lt;b&gt;var&lt;/b&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;previews&lt;/span&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt;: &lt;/span&gt;&lt;b&gt;some&lt;/b&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #d0a8ff;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p7&quot; style=&quot;background-color: #1f1f24; color: #9ef1dd; font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;AsyncImageView&lt;span class=&quot;s2&quot; color=&quot;rgba(255, 255, 255, 0.85)&quot;&gt;()&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;background-color: #1f1f24; color: rgba(255, 255, 255, 0.85); font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;&quot;&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNtcnRhJOwkMPr_pmfEU-bXorQ0HLKO3oUbW-fqjfpVeJ1dkw2PvyhyhRmHK074gUOM5G7Q0JaxE_Ac4b3ETQIqM-AI1b-L1HI2ERgbfn2Xs0aZwp0I9op5zsdKcpq07ctqFL-zgsE1Mo3z7KYkxusu0D7nLgXBzKOq8345cdkk0qyqGqlHWKbnFFclMJN/s2622/1%20AsyncImage.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2622&quot; data-original-width=&quot;1206&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNtcnRhJOwkMPr_pmfEU-bXorQ0HLKO3oUbW-fqjfpVeJ1dkw2PvyhyhRmHK074gUOM5G7Q0JaxE_Ac4b3ETQIqM-AI1b-L1HI2ERgbfn2Xs0aZwp0I9op5zsdKcpq07ctqFL-zgsE1Mo3z7KYkxusu0D7nLgXBzKOq8345cdkk0qyqGqlHWKbnFFclMJN/w294-h640/1%20AsyncImage.png&quot; width=&quot;294&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_7C9_Kka1n-ym1xlleGMUfXMbTK2F8A0oNbbd5IB7CGPKXZ4wJ84jzWbwpth3YlAZYu7oWfMicn36hSwlsKOGLT5cc177fniCyuPflN7FeZ7ZmC7pl-_H2_Fu70ERy9s7ixcW14UnmyV2wiBG_O3sp3TP84XGzuTDPvmy6eOd7km3lrJvhAESx5TAYvln/s2622/2%20AsyncImage.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2622&quot; data-original-width=&quot;1206&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_7C9_Kka1n-ym1xlleGMUfXMbTK2F8A0oNbbd5IB7CGPKXZ4wJ84jzWbwpth3YlAZYu7oWfMicn36hSwlsKOGLT5cc177fniCyuPflN7FeZ7ZmC7pl-_H2_Fu70ERy9s7ixcW14UnmyV2wiBG_O3sp3TP84XGzuTDPvmy6eOd7km3lrJvhAESx5TAYvln/w294-h640/2%20AsyncImage.png&quot; width=&quot;294&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/3134929533141318471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2025/05/asyncimage-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3134929533141318471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3134929533141318471'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2025/05/asyncimage-swiftui.html' title='AsyncImage - SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNtcnRhJOwkMPr_pmfEU-bXorQ0HLKO3oUbW-fqjfpVeJ1dkw2PvyhyhRmHK074gUOM5G7Q0JaxE_Ac4b3ETQIqM-AI1b-L1HI2ERgbfn2Xs0aZwp0I9op5zsdKcpq07ctqFL-zgsE1Mo3z7KYkxusu0D7nLgXBzKOq8345cdkk0qyqGqlHWKbnFFclMJN/s72-w294-h640-c/1%20AsyncImage.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-5588048602761233314</id><published>2020-04-20T19:06:00.001+05:30</published><updated>2020-04-20T19:06:11.469+05:30</updated><title type='text'>PickerView In SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As we know to &lt;span style=&quot;color: blue;&quot;&gt;PickerView&lt;/span&gt; is similar to a Dropdown in iOS. You can select from a set of provided&amp;nbsp; items within a PickerView.&lt;br /&gt;
So let&#39;s get started and add a simple PickerView where user can select a Number from 1 to 10.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Picker&lt;/span&gt;(selection: .&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;constant&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;4&lt;/span&gt;), label: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Select Numbers&quot;&lt;/span&gt;)) {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ForEach&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;..&amp;lt;&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;11&lt;/span&gt;) { index &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;in&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;\(index)&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;).&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;tag&lt;/span&gt;(index)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Explanation:&lt;/b&gt;&lt;br /&gt;
Picker takes two parameters here, &lt;b&gt;selection&lt;/b&gt; and &lt;b&gt;label&lt;/b&gt;.&lt;br /&gt;
&lt;b&gt;selection&lt;/b&gt; means the item which you want to be selected by default (number 5 here).&lt;br /&gt;
&lt;b&gt;label&lt;/b&gt; means the Title of Picker (Select Numbers here).&lt;br /&gt;
Inside PickerView I have passed TextView&#39;s with each having number indexing 1 to 10.&lt;br /&gt;
Hence this PickerView will display numbers 1 to 10.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output Screenshot:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn7Q2wrEiThUa6pcmoZcg5CCBHG9ht2XMadLU_pKR-rZqPJoCBtQyXhBvY3Y8E90jpOAml0YfesJkoU-qBv-rKi_9zlCMmgpt_0B0t8ZDTq1o_fw2GZXj8sKxNs7mIDVwtV6ZjwCIp9n8H/s1600/Screenshot+2020-04-20+at+6.57.21+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;711&quot; data-original-width=&quot;349&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn7Q2wrEiThUa6pcmoZcg5CCBHG9ht2XMadLU_pKR-rZqPJoCBtQyXhBvY3Y8E90jpOAml0YfesJkoU-qBv-rKi_9zlCMmgpt_0B0t8ZDTq1o_fw2GZXj8sKxNs7mIDVwtV6ZjwCIp9n8H/s640/Screenshot+2020-04-20+at+6.57.21+PM.png&quot; width=&quot;313&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/5588048602761233314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/pickerview-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/5588048602761233314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/5588048602761233314'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/pickerview-in-swiftui.html' title='PickerView In SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn7Q2wrEiThUa6pcmoZcg5CCBHG9ht2XMadLU_pKR-rZqPJoCBtQyXhBvY3Y8E90jpOAml0YfesJkoU-qBv-rKi_9zlCMmgpt_0B0t8ZDTq1o_fw2GZXj8sKxNs7mIDVwtV6ZjwCIp9n8H/s72-c/Screenshot+2020-04-20+at+6.57.21+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-464059979722662331</id><published>2020-04-15T16:41:00.000+05:30</published><updated>2020-04-15T16:41:17.774+05:30</updated><title type='text'>Alert &amp; Action Sheet in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Alerts &amp;amp; Action Sheets do work in similar fashion as they do previously in Swift or Objective C.&lt;br /&gt;
Below are the codes to achieve Alert and Action Sheet in SwiftUI.&lt;br /&gt;
Both of these do have Title, Message and Buttons (you can add actions to them).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Alert Sheet Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;choosenAction&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = &lt;/span&gt;&quot;Hit the button to show Alert&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;showAlert&lt;/span&gt;: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Bool&lt;/span&gt; = &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;false&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt; (spacing: &lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;50&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;choosenAction&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;largeTitle&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;green&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Button&lt;/span&gt;(action: {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;showAlert&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;toggle&lt;/span&gt;()&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;TOGGLE NAMES&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;padding&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;all&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;headline&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;white&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;background&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;cornerRadius&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;alert&lt;/span&gt;(isPresented: &lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;$showAlert&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Alert&lt;/span&gt;(title: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Alert&quot;&lt;/span&gt;), message: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Yeh!!! we have shown Alert&quot;&lt;/span&gt;), dismissButton: .&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;OK&quot;&lt;/span&gt;)))&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMop8cuNkMeha_hj03rEDg97NNa78QTX_1C29BoUZw_ORfVkPB3ZrIZb-X-z88Hkc2-29CwG9QH2c6ZwBkgmQ-ZKTV1fj-wj_z23A26Ac41vBcchiytCLe57SCNDjST0uveT5xCQkG6bEy/s1600/Screenshot+2020-04-15+at+4.35.02+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;708&quot; data-original-width=&quot;347&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMop8cuNkMeha_hj03rEDg97NNa78QTX_1C29BoUZw_ORfVkPB3ZrIZb-X-z88Hkc2-29CwG9QH2c6ZwBkgmQ-ZKTV1fj-wj_z23A26Ac41vBcchiytCLe57SCNDjST0uveT5xCQkG6bEy/s400/Screenshot+2020-04-15+at+4.35.02+PM.png&quot; width=&quot;195&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Action Sheet Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;choosenAction&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = &lt;/span&gt;&quot;Hit the button and choose from ActionSheet&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;showAlert&lt;/span&gt;: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Bool&lt;/span&gt; = &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;false&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt; (spacing: &lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;50&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;choosenAction&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;largeTitle&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;green&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Button&lt;/span&gt;(action: {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;showAlert&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;toggle&lt;/span&gt;()&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;TOGGLE NAMES&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;padding&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;all&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;headline&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;white&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;background&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;cornerRadius&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;actionSheet&lt;/span&gt;(isPresented: &lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;$showAlert&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ActionSheet&lt;/span&gt;(title: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;What do you want to do?&quot;&lt;/span&gt;), message: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Choose from below actions&quot;&lt;/span&gt;), buttons: [.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;OK&quot;&lt;/span&gt;), action: {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;choosenAction&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = &lt;/span&gt;&quot;You selected &#39;OK&#39; from Action Sheet&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}), .&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;destructive&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;CANCEL&quot;&lt;/span&gt;), action: {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;choosenAction&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = &lt;/span&gt;&quot;You selected &#39;CANCEL&#39; from Action Sheet&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;})])&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJnRQfPxPLG628FQ3gmxJjKkQhho_tT6i3Fb8PR44lmxpZwcGnPvr4n9jFrkbvas8R3kJLCeBiGLAib4nh2lg21NyI6ZDnKY4fJgWmz5SRNefkt8dWKFn1HaTKGI4qbkVv4vGsx8LDgyDu/s1600/Screenshot+2020-04-15+at+4.36.10+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;701&quot; data-original-width=&quot;351&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJnRQfPxPLG628FQ3gmxJjKkQhho_tT6i3Fb8PR44lmxpZwcGnPvr4n9jFrkbvas8R3kJLCeBiGLAib4nh2lg21NyI6ZDnKY4fJgWmz5SRNefkt8dWKFn1HaTKGI4qbkVv4vGsx8LDgyDu/s400/Screenshot+2020-04-15+at+4.36.10+PM.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/464059979722662331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/alert-action-sheet-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/464059979722662331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/464059979722662331'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/alert-action-sheet-in-swiftui.html' title='Alert &amp; Action Sheet in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMop8cuNkMeha_hj03rEDg97NNa78QTX_1C29BoUZw_ORfVkPB3ZrIZb-X-z88Hkc2-29CwG9QH2c6ZwBkgmQ-ZKTV1fj-wj_z23A26Ac41vBcchiytCLe57SCNDjST0uveT5xCQkG6bEy/s72-c/Screenshot+2020-04-15+at+4.35.02+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-3372557788524376100</id><published>2020-04-10T18:19:00.000+05:30</published><updated>2020-04-10T18:19:08.573+05:30</updated><title type='text'>Grid in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In previous posts we have worked on TableView (List), now you would be curious to know about the CollectionView or Grid in SwiftUI.&lt;div&gt;
So there is no such thing as CollectionView in SwiftUI. &lt;span style=&quot;color: red; font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;b&gt;&lt;i&gt;Oh.. noooo...&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Lets discuss how to get a Grid in SwiftUI.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Code Snippet:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;List&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ForEach&lt;/span&gt; (&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;..&amp;lt;&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;) { row &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;in&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;HStack&lt;/span&gt; (spacing: &lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;20&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ForEach&lt;/span&gt; (&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;..&amp;lt;&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;3&lt;/span&gt;) { column &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;in&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ZStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;cornerRadius&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;20&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;span class=&quot;s1&quot; style=&quot;color: #00a0be;&quot;&gt;onTapGesture&lt;/span&gt;(count: &lt;span class=&quot;s2&quot; style=&quot;color: #786dc4;&quot;&gt;1&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #00a0be;&quot;&gt;print&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Selected Row&lt;/span&gt;\(row)&lt;span class=&quot;s3&quot; style=&quot;color: #db2c38;&quot;&gt; &amp;amp; Column&lt;/span&gt;\(column)&lt;span class=&quot;s3&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;R&lt;/span&gt;\(row)&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt; - C&lt;/span&gt;\(column)&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Explanation of Code:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
For this we have to take two ForEach Loops, one for drawing Rows and the other one for columns.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Steps:&lt;/div&gt;
&lt;div&gt;
1. Take a &lt;b&gt;List&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
2. Inside the List add a &lt;b&gt;first ForEach Loop&lt;/b&gt; for drawing the &lt;b&gt;Rows&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
3. Now to add Columns in Horizontal manner add a &lt;b&gt;HStack&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
4. Inside this HStack add the &lt;b&gt;second ForEach loop &lt;/b&gt;for drawing the &lt;b&gt;Columns&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
5. To place Text above Color I added a &lt;b&gt;ZStack&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
6. Inside this ZStack add the &lt;b&gt;Color&lt;/b&gt; (and set its properties) and add the &lt;b&gt;Text&lt;/b&gt; (to display the Row and Column number).&lt;/div&gt;
&lt;div&gt;
That&#39;s it guys we have our Grid ready. Hit the&amp;nbsp;&lt;b&gt;&lt;i&gt;Cmd + Opt + p&lt;/i&gt;&lt;/b&gt; combination to see the preview.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Output:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1WkpXkmM1paLcYWDJaNlJXbZnOUbZX_gbcsPg-rCVMtwx6gP-8C6j1YwfqSnPH8pXSvTJ4U9K7EwIh8zFrr1LfNHk45XXCEp01xxNJHzPUef9wzr_cwS7ti8BcK0sxdvNGfdnKZqIzMyT/s1600/Screenshot+2020-04-10+at+5.29.12+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;715&quot; data-original-width=&quot;346&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1WkpXkmM1paLcYWDJaNlJXbZnOUbZX_gbcsPg-rCVMtwx6gP-8C6j1YwfqSnPH8pXSvTJ4U9K7EwIh8zFrr1LfNHk45XXCEp01xxNJHzPUef9wzr_cwS7ti8BcK0sxdvNGfdnKZqIzMyT/s640/Screenshot+2020-04-10+at+5.29.12+PM.png&quot; width=&quot;308&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/3372557788524376100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/grid-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3372557788524376100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3372557788524376100'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/grid-in-swiftui.html' title='Grid in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1WkpXkmM1paLcYWDJaNlJXbZnOUbZX_gbcsPg-rCVMtwx6gP-8C6j1YwfqSnPH8pXSvTJ4U9K7EwIh8zFrr1LfNHk45XXCEp01xxNJHzPUef9wzr_cwS7ti8BcK0sxdvNGfdnKZqIzMyT/s72-c/Screenshot+2020-04-10+at+5.29.12+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-8862212511458897244</id><published>2020-04-08T20:09:00.000+05:30</published><updated>2020-04-15T16:07:57.068+05:30</updated><title type='text'>Button in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Lets learn how to work with a Button in SwiftUI.&lt;br /&gt;
&lt;br /&gt;
Let me explain the code snippet:&lt;br /&gt;
1. Two private variables, one is &lt;b&gt;buttonClicked&lt;/b&gt; which is a Bool that will toggle on button click action and the other is &lt;b&gt;textOnLabel&lt;/b&gt; is a String with a default as BLACK.&lt;br /&gt;
2. In body I have a &lt;b&gt;VStack&lt;/b&gt; with spacing 50, it will add a spacing of 50 between UIControls added inside the stack.&lt;br /&gt;
3. Inside this VStack; I wanted to have a &lt;b&gt;Text&lt;/b&gt; (to display the Background Color of Button) and a &lt;b&gt;Button&lt;/b&gt;.&lt;br /&gt;
4. Inside Button&#39;s action closure I toggled the bool value of var&amp;nbsp;&lt;b&gt;buttonClicked&lt;/b&gt; and made a call to method &lt;b&gt;buttonAction()&lt;/b&gt;.&lt;br /&gt;
5. Inside this&amp;nbsp;&lt;b&gt;buttonAction&lt;/b&gt;&amp;nbsp;method I just changed the text of&amp;nbsp;&lt;b&gt;textOnLabel&lt;/b&gt;&amp;nbsp;based on the&amp;nbsp;&lt;b&gt;buttonClicked &lt;/b&gt;bool value.&lt;br /&gt;
6. To make Button UI better I added padding, background color, foreground color and cornerradius to it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;color: #b21889; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;private&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;var&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;buttonClicked&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = &lt;/span&gt;false&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;textOnLabel&lt;/span&gt;: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;String&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;BLACK&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt;(spacing: &lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;50&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;textOnLabel&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;largeTitle&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;green&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Button&lt;/span&gt;(action: {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;buttonClicked&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;toggle&lt;/span&gt;()&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;buttonAction&lt;/span&gt;()&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}) {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;HIT ME&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;largeTitle&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p4&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;padding&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;init&lt;/span&gt;(top: &lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;, leading: &lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;20&lt;/span&gt;, bottom: &lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;, trailing: &lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;20&lt;/span&gt;))&lt;/div&gt;
&lt;div class=&quot;p5&quot; style=&quot;color: #00a0be; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;/span&gt;background&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;buttonClicked&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;==&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; ? &lt;/span&gt;Color&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;orange&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; : &lt;/span&gt;Color&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;black&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot; style=&quot;color: #00a0be; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;/span&gt;foregroundColor&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;buttonClicked&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;==&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; ? &lt;/span&gt;Color&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;black&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; : &lt;/span&gt;Color&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;.&lt;/span&gt;white&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;cornerRadius&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p4&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot; style=&quot;color: #41a1c0; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;buttonAction&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;buttonClicked&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;true&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;textOnLabel&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;ORANGE&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;} &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;else&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;textOnLabel&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;BLACK&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;color: white; font-family: Menlo; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSW1et0I6z27x0irYzQODp0jZfpqEGIJedCpcgJzz37RB2o4YalnTYOPodQgpneWbrALlTcZclTQLCkf28JGxfHrZkhroJ7YS8o3IvPRPt98hus8YHoynPY8jBmj8-FewyCgZTUbG3KHvu/s1600/Screenshot+2020-04-09+at+11.16.58+AM.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;717&quot; data-original-width=&quot;350&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSW1et0I6z27x0irYzQODp0jZfpqEGIJedCpcgJzz37RB2o4YalnTYOPodQgpneWbrALlTcZclTQLCkf28JGxfHrZkhroJ7YS8o3IvPRPt98hus8YHoynPY8jBmj8-FewyCgZTUbG3KHvu/s400/Screenshot+2020-04-09+at+11.16.58+AM.png&quot; width=&quot;195&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBpvPNGkvEEBmVrZxYv1NZItzXicpTEVJuCJvhsDYNelGcWQHAguk3wg8f-9lUZNxx1NGuKjzpMEG3MsL_SEY3Fx4aiZJ2pg0KDF7pmZT56cSNKAS0cC91XxK53pPV9T2h6v6-_WF6LIdj/s1600/Screenshot+2020-04-09+at+11.17.08+AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;705&quot; data-original-width=&quot;350&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBpvPNGkvEEBmVrZxYv1NZItzXicpTEVJuCJvhsDYNelGcWQHAguk3wg8f-9lUZNxx1NGuKjzpMEG3MsL_SEY3Fx4aiZJ2pg0KDF7pmZT56cSNKAS0cC91XxK53pPV9T2h6v6-_WF6LIdj/s400/Screenshot+2020-04-09+at+11.17.08+AM.png&quot; width=&quot;195&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another simple code snippet to check how Button works:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;myName&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;SUMERA&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt; (spacing: &lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;50&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;myName&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;largeTitle&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;green&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Button&lt;/span&gt;(action: {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;myName&lt;/span&gt; = (&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;myName&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;SUMERA&quot;&lt;/span&gt;) ? &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;AMARA&quot;&lt;/span&gt; : &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;SUMERA&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}) {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;TOGGLE NAMES&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;padding&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;all&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;headline&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;white&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;background&lt;/span&gt;(&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;cornerRadius&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1mRKolNM_y8fMOBXXH6KhwVB_z0EWVJAY3-RJwaXqV8iAg32fieU9WF75v9jwIiN0Dy0Ifl5-mYuH6yr2iWGMfu_kZWxDmJJb-cD27a2IllPq5oXbs7tIH-KgxWoO13MhsI53L35ZsfDn/s1600/Screenshot+2020-04-15+at+4.06.17+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;705&quot; data-original-width=&quot;345&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1mRKolNM_y8fMOBXXH6KhwVB_z0EWVJAY3-RJwaXqV8iAg32fieU9WF75v9jwIiN0Dy0Ifl5-mYuH6yr2iWGMfu_kZWxDmJJb-cD27a2IllPq5oXbs7tIH-KgxWoO13MhsI53L35ZsfDn/s400/Screenshot+2020-04-15+at+4.06.17+PM.png&quot; width=&quot;195&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_1nfEuCYuwsCvEQ3yVdfVk0_lNF1A0tjBWfMm5S6QuxTvZxk-QzYFcLRP7UcFc2uUAY9KXxQ1ou6Lqhzl96dn5yPz9xvDboC9DKUzgbaVjYonLUvZmwE9qQAht_YUmZuOlqR5CmJv4uQ2/s1600/Screenshot+2020-04-15+at+4.06.24+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;701&quot; data-original-width=&quot;348&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_1nfEuCYuwsCvEQ3yVdfVk0_lNF1A0tjBWfMm5S6QuxTvZxk-QzYFcLRP7UcFc2uUAY9KXxQ1ou6Lqhzl96dn5yPz9xvDboC9DKUzgbaVjYonLUvZmwE9qQAht_YUmZuOlqR5CmJv4uQ2/s400/Screenshot+2020-04-15+at+4.06.24+PM.png&quot; width=&quot;197&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/8862212511458897244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/button-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8862212511458897244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8862212511458897244'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/button-in-swiftui.html' title='Button in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSW1et0I6z27x0irYzQODp0jZfpqEGIJedCpcgJzz37RB2o4YalnTYOPodQgpneWbrALlTcZclTQLCkf28JGxfHrZkhroJ7YS8o3IvPRPt98hus8YHoynPY8jBmj8-FewyCgZTUbG3KHvu/s72-c/Screenshot+2020-04-09+at+11.16.58+AM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-8873154271551002117</id><published>2020-04-07T20:37:00.001+05:30</published><updated>2020-04-07T20:37:28.177+05:30</updated><title type='text'>Stack in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In previous post we have used Stack but i have not explained it there.&lt;br /&gt;
SwiftUI allows us to add nested Stacks too means you can have a HStack inside a VStack or vice-versa or any other combinations.&lt;br /&gt;
&lt;br /&gt;
SwiftUI has categorized Stack into 3 types:&lt;br /&gt;
1. &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;HStack&lt;/span&gt;&lt;/b&gt; - Horizontal Stack&lt;br /&gt;
2. &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;VStack&lt;/span&gt;&lt;/b&gt; - Vertical Stack&lt;br /&gt;
3. &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;ZStack&lt;/span&gt;&lt;/b&gt; - Z Index Stack&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;HStack&lt;/span&gt;&lt;/b&gt;&amp;nbsp;- If you want to place UI horizontally use this type.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Snipped:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;HStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;blue&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;&lt;b&gt;Explanation - &lt;/b&gt;Here i have created a HStack and added two Color&#39;s namely red and blue.&lt;br /&gt;
Now you would like to ask me how you can add a Color instead of a View!!!&lt;br /&gt;
So in SwiftUI we can treat Color also as a View, let me elaborate it.&lt;br /&gt;
It will draw a View within a provided space by the HStack and fill it with the provided Color and returns it as a View.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output of Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4LVfwgwchY3nprTAUJLKcDp1Kmwi2XWL45me48X5MYYLeOUkSrrZTfHMSYGRFgR1ZLaoi96G1E-SanJ8yGr-IDRNDMc7WfMJjzSP6D4V-s3wUSR2foC9qiBgArovK7GelbATOelmj2N3a/s1600/Screenshot+2020-04-07+at+8.18.19+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;731&quot; data-original-width=&quot;413&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4LVfwgwchY3nprTAUJLKcDp1Kmwi2XWL45me48X5MYYLeOUkSrrZTfHMSYGRFgR1ZLaoi96G1E-SanJ8yGr-IDRNDMc7WfMJjzSP6D4V-s3wUSR2foC9qiBgArovK7GelbATOelmj2N3a/s400/Screenshot+2020-04-07+at+8.18.19+PM.png&quot; width=&quot;225&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;VStack&lt;/span&gt;&lt;/b&gt;&amp;nbsp;-&amp;nbsp;This will add a Vertical Stack to your View.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;blue&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Explanation -&lt;/b&gt;&amp;nbsp;Similar to HStack here we have the VStack it will place the items in Vertical manner. Red color on top and blue color on bottom.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output of Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu9Ihfq6i8o8nlo6kybMhCsmFDNWZm8MWOgIwGSdrFWGrfQ9oDPSE29WtfPhL7RqQrduqdbEWUwuGrjyS0cLPbJMtMRkVHHIogqwCNd-00BcBrIjTTK_d6dbKs0pHO-TtdRnWu-agkfYB8/s1600/Screenshot+2020-04-07+at+8.18.32+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;734&quot; data-original-width=&quot;420&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu9Ihfq6i8o8nlo6kybMhCsmFDNWZm8MWOgIwGSdrFWGrfQ9oDPSE29WtfPhL7RqQrduqdbEWUwuGrjyS0cLPbJMtMRkVHHIogqwCNd-00BcBrIjTTK_d6dbKs0pHO-TtdRnWu-agkfYB8/s400/Screenshot+2020-04-07+at+8.18.32+PM.png&quot; width=&quot;227&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;ZStack&lt;/span&gt;&lt;/b&gt;&amp;nbsp;- If you want to place items one above another this is the one you can use.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ZStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;(&lt;/span&gt;&quot;This is On the Top of Red Color View&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;white&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Explanation -&lt;/b&gt;&lt;br /&gt;
Sometimes we need to place some item above other, like a Text on Image. So here we have a ZStack here to make it simple. I have placed a Text above the Color.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output of Code Snippet:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6QLwJEO3Zhov3Nlvj_mtpvRFIueKFBsLWQIwuJPnNuH0-RdMd6QZqUkmZHLSOD6qb9TkEDvp2ZvNPHUpJ1Hwtj59qgdSAbKk60T67FEgZw9DiODg-jOLgz3467njY6gfs2Ddkara6KImd/s1600/Screenshot+2020-04-07+at+8.27.21+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;738&quot; data-original-width=&quot;413&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6QLwJEO3Zhov3Nlvj_mtpvRFIueKFBsLWQIwuJPnNuH0-RdMd6QZqUkmZHLSOD6qb9TkEDvp2ZvNPHUpJ1Hwtj59qgdSAbKk60T67FEgZw9DiODg-jOLgz3467njY6gfs2Ddkara6KImd/s400/Screenshot+2020-04-07+at+8.27.21+PM.png&quot; width=&quot;222&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here is a code snippet for nested Stack:&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;HStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;green&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Color&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;blue&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Explanation -&lt;/b&gt;&amp;nbsp;I have added a VStack inside HStack, so the left side will have two Color Views red and green.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output of Code Snipped:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-ZXjtGb-o4DvRPuj7brli0DSgUDes4IMjq9lYUvQZsMninEkPjkFLV1G9HbY_Mx5dhVgzVABlv0VtwnMTfuTwx2uHGcKSu_i_SSsr-AFv20p_2seuLejbLJ4xH0X6Yl6ymj4jqM6PQJdt/s1600/Screenshot+2020-04-07+at+8.34.23+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;733&quot; data-original-width=&quot;420&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-ZXjtGb-o4DvRPuj7brli0DSgUDes4IMjq9lYUvQZsMninEkPjkFLV1G9HbY_Mx5dhVgzVABlv0VtwnMTfuTwx2uHGcKSu_i_SSsr-AFv20p_2seuLejbLJ4xH0X6Yl6ymj4jqM6PQJdt/s400/Screenshot+2020-04-07+at+8.34.23+PM.png&quot; width=&quot;228&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/8873154271551002117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/stack-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8873154271551002117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8873154271551002117'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/stack-in-swiftui.html' title='Stack in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4LVfwgwchY3nprTAUJLKcDp1Kmwi2XWL45me48X5MYYLeOUkSrrZTfHMSYGRFgR1ZLaoi96G1E-SanJ8yGr-IDRNDMc7WfMJjzSP6D4V-s3wUSR2foC9qiBgArovK7GelbATOelmj2N3a/s72-c/Screenshot+2020-04-07+at+8.18.19+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-7368291616407310876</id><published>2020-04-07T19:30:00.003+05:30</published><updated>2020-04-07T19:30:59.608+05:30</updated><title type='text'>Table with Dynamic Cell in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In previous Post I demonstrated the ways we can have a Table in SwiftUI.&lt;br /&gt;
Now lets get started to a simple demo where we can load dynamic info in table cell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am creating a snippet where I want to load Roll Number and Name of students of a class in Table.&lt;br /&gt;
For this I used List which will create rows equal to rollNosArray count (i.e. 4 for now).&lt;br /&gt;
&lt;br /&gt;
1. Lets have two arrays, first for names and the other for roll numbers.&lt;br /&gt;
2. Iterate List through the rollNosArray, so we will have 4 rows/cells.&lt;br /&gt;
3. Now create a new Struct named DynamicCell. This is our custom dynamic cell.&lt;br /&gt;
4. As per my need I wanted Two Labels to display info inside a row horizontally.&lt;br /&gt;
5. So I took a &lt;b&gt;HStack&lt;/b&gt; and inside it added two &lt;b&gt;Text&lt;/b&gt;.&lt;br /&gt;
6. For a clear separation between two Text&#39;s I added a &lt;b&gt;Divider&lt;/b&gt;.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
7. Back to our ContentView Struct, inside List call this DynamicCell and pass the value to the two variables declared in DynamicCell Struct (name and rollNumber).&lt;br /&gt;
8. Execute the code and we have our expected Table with dynamic rows.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;namesArray&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = [&lt;/span&gt;&quot;Amit&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;, &lt;/span&gt;&quot;Javed&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;, &lt;/span&gt;&quot;Suhel&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; , &lt;/span&gt;&quot;Suraj&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;rollNosArray&lt;/span&gt; = [&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;01&quot;&lt;/span&gt;, &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;02&quot;&lt;/span&gt;, &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;03&quot;&lt;/span&gt; , &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;04&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;List&lt;/span&gt; (&lt;span class=&quot;s6&quot; style=&quot;color: #786dc4;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;..&amp;lt;&lt;/span&gt;&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;rollNosArray&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;count&lt;/span&gt;) { index &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;in&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;DynamicCell&lt;/span&gt;(rollNumber: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;rollNosArray&lt;/span&gt;[index], name: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;namesArray&lt;/span&gt;[index])&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p4&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;DynamicCell&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot; style=&quot;background-color: #1e2028; color: #41a1c0; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;rollNumber&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;name&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;HStack&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Roll Number - &lt;/span&gt;\(&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;rollNumber&lt;/span&gt;)&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Divider&lt;/span&gt;()&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Name - &lt;/span&gt;\(&lt;span class=&quot;s7&quot; style=&quot;color: #83c057;&quot;&gt;name&lt;/span&gt;)&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8jlOerByA3RTNx1XwulMrkOh2Kr1pT2MHN5vymGmp9H83d4OHDyI7xmwHHi0Xzca6lvwrHrWI9CSdut9nxJKAjQ2jPQRa8Uz8Fqu5Y_G_eZ3Lir0kOPbbuTH14_m2QPVFYyV8CPdSNk4/s1600/Screenshot+2020-04-07+at+7.30.11+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;746&quot; data-original-width=&quot;418&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8jlOerByA3RTNx1XwulMrkOh2Kr1pT2MHN5vymGmp9H83d4OHDyI7xmwHHi0Xzca6lvwrHrWI9CSdut9nxJKAjQ2jPQRa8Uz8Fqu5Y_G_eZ3Lir0kOPbbuTH14_m2QPVFYyV8CPdSNk4/s640/Screenshot+2020-04-07+at+7.30.11+PM.png&quot; width=&quot;356&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/7368291616407310876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/table-with-dynamic-cell-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/7368291616407310876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/7368291616407310876'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/table-with-dynamic-cell-in-swiftui.html' title='Table with Dynamic Cell in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8jlOerByA3RTNx1XwulMrkOh2Kr1pT2MHN5vymGmp9H83d4OHDyI7xmwHHi0Xzca6lvwrHrWI9CSdut9nxJKAjQ2jPQRa8Uz8Fqu5Y_G_eZ3Lir0kOPbbuTH14_m2QPVFYyV8CPdSNk4/s72-c/Screenshot+2020-04-07+at+7.30.11+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-6624745030897991271</id><published>2020-04-06T19:31:00.001+05:30</published><updated>2020-04-06T19:31:45.821+05:30</updated><title type='text'>Table in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In many apps we require list of items in a scrollable format, for this we used UITableView as of now.&lt;div&gt;
In SwiftUI we have many ways to create a Table. I will try to cover a few ways here.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
1.&lt;b&gt;&amp;nbsp;ForEach Loop with List:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;List&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ForEach&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;..&amp;lt;&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;) { index&amp;nbsp;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;in&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Current Row -&amp;nbsp;&lt;/span&gt;\(index)&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.&lt;b&gt;&amp;nbsp;List directly:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;List&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;..&amp;lt;&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;10&lt;/span&gt;) { index&amp;nbsp;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;in&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Current Row -&amp;nbsp;&lt;/span&gt;\(index)&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3. &lt;b&gt;Form directly:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Form&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Row 0&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Row 1&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Row 2&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4.&lt;b&gt;&amp;nbsp;Form with Sections:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Form&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Section&lt;/span&gt; (header: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;SECTION 0 Starts Here&quot;&lt;/span&gt;), content: {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Section 0 Row 0&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Section 0 Row 1&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Section 0 Row 2&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;})&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Section&lt;/span&gt; (footer: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;SECTION 1 Ends Here&quot;&lt;/span&gt;)) {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Section 1 Row 0&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Section 1 Row 1&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Section 1 Row 2&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5. &lt;b&gt;Form with VStack:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Form&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;VStack&lt;/span&gt;(alignment:.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;leading&lt;/span&gt; , spacing:&lt;span class=&quot;s5&quot; style=&quot;color: #786dc4;&quot;&gt;50&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Row 0&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Row 1&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s6&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Row 2&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So we now know we have many ways to get started with a Table in SwiftUI.&lt;/div&gt;
&lt;div&gt;
In our next tutorial lets try to create a Reusable Cell.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/6624745030897991271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/table-in-swiftui.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/6624745030897991271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/6624745030897991271'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/table-in-swiftui.html' title='Table in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-931541280470208214</id><published>2020-04-06T17:06:00.001+05:30</published><updated>2020-04-06T17:06:24.580+05:30</updated><title type='text'>Binding &amp; State of Variables in SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
All apps take some user inputs, display output by reflecting the correct changes and modifications. Suppose I have a login screen, until the user has entered the Username and Password I wont enable the Login button. Once the users satisfies this scenario I should reflect the change by enabling the Login Button.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;name&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;age&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Form&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;(&lt;/span&gt;&quot;Personal Details Form&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;headline&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;TextField&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Name&quot;&lt;/span&gt;, text: &lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;$name&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;TextField&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Age&quot;&lt;/span&gt;, text: &lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;$age&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Your Name - &lt;/span&gt;\(&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;name&lt;/span&gt;)&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Your Age - &lt;/span&gt;\(&lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;age&lt;/span&gt;)&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
So as to make this possible in SwiftUI we have to use &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;@State&lt;/span&gt;&lt;/b&gt; attribute while declaration of a variable. So now SwiftUI will itself keep watch on any changes occurring with this variable and update the UI where it has been used.&lt;br /&gt;
Now you would ask why I have used that &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;$&lt;/span&gt;&lt;/b&gt; sign with these variables while using them with TextFields. It is because SwiftUI tries to refer to the actual data rather than the properties current value.&amp;nbsp;Here $ is for Two Way Binding. It is required to show the data of the property here and write it back to the property.&lt;br /&gt;
In above code snippet I have two TextFields and two Texts (you can say Labels), now as user tries to enter name and age character by character the name and age will be reflected instantly to the Texts.&lt;br /&gt;
Give it a shot and you would find this very helpful.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdRV2Ug1fLXBeHC04hlz95vfiOodnXqniM5NSd8TqmX15UIIcMAgFUa9OTXtrJs3i9Tj9mwpNrrKe83V4ShlAIMZOES5BluVNESITIWg_eDwzGcf_uZRJOY1w7j6AF5BvxIvJvWsPpIsZC/s1600/Screenshot+2020-04-06+at+5.05.04+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;703&quot; data-original-width=&quot;327&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdRV2Ug1fLXBeHC04hlz95vfiOodnXqniM5NSd8TqmX15UIIcMAgFUa9OTXtrJs3i9Tj9mwpNrrKe83V4ShlAIMZOES5BluVNESITIWg_eDwzGcf_uZRJOY1w7j6AF5BvxIvJvWsPpIsZC/s1600/Screenshot+2020-04-06+at+5.05.04+PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/931541280470208214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/binding-state-of-variables-in-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/931541280470208214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/931541280470208214'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/04/binding-state-of-variables-in-swiftui.html' title='Binding &amp; State of Variables in SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdRV2Ug1fLXBeHC04hlz95vfiOodnXqniM5NSd8TqmX15UIIcMAgFUa9OTXtrJs3i9Tj9mwpNrrKe83V4ShlAIMZOES5BluVNESITIWg_eDwzGcf_uZRJOY1w7j6AF5BvxIvJvWsPpIsZC/s72-c/Screenshot+2020-04-06+at+5.05.04+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-3618770308393606991</id><published>2020-03-09T16:58:00.003+05:30</published><updated>2020-04-06T16:36:22.225+05:30</updated><title type='text'>SwiftUI - Form</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Many a times we need to design a User Interface where we need to take users inputs in TextFields, Date Pickers, Pickers, Toggles. As of now what we followed is we either used a ScrollView for a fixed set of inputs or TableView for list of inputs. SwiftUI provides us with a simple solution called &lt;b&gt;Form&lt;/b&gt; for this.&lt;br /&gt;
Form is a container or a collection of user input controls. Forms can contain Sections which can group input controls. Also keep that in mind that forms are scrollable, we don&#39;t need to worry about what will happen if we add multiple items and it gets out of the screen.&lt;br /&gt;
&lt;br /&gt;
Lets see following example:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: #5dd8ff; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; &lt;/span&gt;ContentView&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;name&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;age&lt;/span&gt; = &lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;s4&quot; style=&quot;color: #41a1c0;&quot;&gt;body&lt;/span&gt;: &lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;View&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Form&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;background-color: #1e2028; color: #db2c38; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;(&lt;/span&gt;&quot;Personal Details Form&quot;&lt;span class=&quot;s2&quot; style=&quot;color: white;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;font&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;headline&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;foregroundColor&lt;/span&gt;(.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;red&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;TextField&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Name&quot;&lt;/span&gt;, text: &lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;$name&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;TextField&lt;/span&gt;(&lt;span class=&quot;s5&quot; style=&quot;color: #db2c38;&quot;&gt;&quot;Age&quot;&lt;/span&gt;, text: &lt;span class=&quot;s6&quot; style=&quot;color: #83c057;&quot;&gt;$age&lt;/span&gt;)&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
This is an input form with a label and two textfields.&lt;br /&gt;
Avoid variables name and age for now I will explain it in my next Post.&lt;br /&gt;
&lt;br /&gt;
Output is like this:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0k0usj_yym-HO2iA2GmmSl1k8MgMPJjX7zGvES_J0lgZJnNbgmMxJNA9NIDaUtazVLQuECLlYSJLvuPHVCEuR9WMjTd3c5bogJ0IfHgUwCOhO5JYEXJT-mMEqczMJHjp7jqhiGylYu4K/s1600/Screenshot+2020-03-09+at+4.53.46+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;910&quot; data-original-width=&quot;500&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0k0usj_yym-HO2iA2GmmSl1k8MgMPJjX7zGvES_J0lgZJnNbgmMxJNA9NIDaUtazVLQuECLlYSJLvuPHVCEuR9WMjTd3c5bogJ0IfHgUwCOhO5JYEXJT-mMEqczMJHjp7jqhiGylYu4K/s640/Screenshot+2020-03-09+at+4.53.46+PM.png&quot; width=&quot;348&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/3618770308393606991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/03/swiftui-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3618770308393606991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3618770308393606991'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/03/swiftui-from.html' title='SwiftUI - Form'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0k0usj_yym-HO2iA2GmmSl1k8MgMPJjX7zGvES_J0lgZJnNbgmMxJNA9NIDaUtazVLQuECLlYSJLvuPHVCEuR9WMjTd3c5bogJ0IfHgUwCOhO5JYEXJT-mMEqczMJHjp7jqhiGylYu4K/s72-c/Screenshot+2020-03-09+at+4.53.46+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-5667010202505852929</id><published>2020-03-09T15:51:00.001+05:30</published><updated>2020-03-09T15:51:29.513+05:30</updated><title type='text'>SwiftUI UIControls</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Let&#39;s see what UIControls we have to design UI in SwiftUI.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;font-kerning: none; text-decoration-line: underline;&quot;&gt;&lt;b&gt;UIKit&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-kerning: none; text-decoration-line: underline;&quot;&gt;&lt;b&gt;SwiftUI&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIViewController&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;View&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UITableViewController&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;List&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UINavigationViewController&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;NavigationView&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UITabViewController&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;TabView&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIAlertViewController&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Alert&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UILabel&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Text&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UITextField&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;TextField&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIStackView&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;1. VStack 2. HStack 3. ZStack&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIScrollView&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ScrollView&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIImageView&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Image&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIPickerView&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Picker&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIButton&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Button&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIDatePicker&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;DatePicker&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UISlider&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Slider&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UIStepper&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Stepper&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;UISwitch&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toggle&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;I know this is not a complete list; I am too exploring it.&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-OZuu9Eypn-FHx2hvrJYhJKLDmWDosIrqFEzWvaOo9eolcVV0piW6r4LA6l556iNPsuzmDofIYDnpizigM3bxGQnth75SSSTFYyC_YqgtR7AQG9g_pprbKYbA7PFYBFm4BT1NcR4H6H_p/s1600/ContentView.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;365&quot; data-original-width=&quot;406&quot; height=&quot;287&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-OZuu9Eypn-FHx2hvrJYhJKLDmWDosIrqFEzWvaOo9eolcVV0piW6r4LA6l556iNPsuzmDofIYDnpizigM3bxGQnth75SSSTFYyC_YqgtR7AQG9g_pprbKYbA7PFYBFm4BT1NcR4H6H_p/s320/ContentView.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;b&gt;ContentView.swift&lt;/b&gt; is the file where we are going to code. By default we get a Text as Hello, World!&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
Let&#39;s see what this file actually means and what it does.&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
So here we have two structures:&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&amp;nbsp;ContentView struct - This is the place to code or design.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;ContentView_Previews struct - From here your canvas renders your code.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
1. ContentView struct - Here we are returning a Text as some view. some view means any view here, we can return a Text, TextField, NavigationView, List, etc.&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
Now you will ask what I wish to add multiple Text?&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
For this you need to club it using either List, Group, VStack, Hstack, etc.&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
2. ContentView_Previews struct - Here too we are returning some view, but now we are returning the complete ContentView() as some view.&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/5667010202505852929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/03/swiftui-uicontrols.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/5667010202505852929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/5667010202505852929'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/03/swiftui-uicontrols.html' title='SwiftUI UIControls'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-OZuu9Eypn-FHx2hvrJYhJKLDmWDosIrqFEzWvaOo9eolcVV0piW6r4LA6l556iNPsuzmDofIYDnpizigM3bxGQnth75SSSTFYyC_YqgtR7AQG9g_pprbKYbA7PFYBFm4BT1NcR4H6H_p/s72-c/ContentView.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-7071251548564321809</id><published>2020-03-09T13:06:00.000+05:30</published><updated>2020-03-09T13:06:10.467+05:30</updated><title type='text'>Intro to SwiftUI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As we all know SwiftUI is here and it has completely changed development of apps, not only the UI but the way we code.&lt;br /&gt;
&lt;br /&gt;
Basic Requirement For Development and Deployment:&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Xcode 11 or above&lt;/li&gt;
&lt;li&gt;iOS 13 or above&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
Here I have created a new project selecting SwiftUI as User Interface.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ1nLfEeXs7uEV15wzbG9QnlrVSvLxevPTWTTFBakoDIyoiNnfijjbwEhcx5nDj1ZW8FllFaeW_bx4upp67yFXf1iAi-5It97ERfQDno3iDb8CM9sBvHVggjZfv1H0WQ4Nb_XWNUpg1ZRH/s1600/Screenshot+2020-03-09+at+12.40.49+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;585&quot; data-original-width=&quot;779&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ1nLfEeXs7uEV15wzbG9QnlrVSvLxevPTWTTFBakoDIyoiNnfijjbwEhcx5nDj1ZW8FllFaeW_bx4upp67yFXf1iAi-5It97ERfQDno3iDb8CM9sBvHVggjZfv1H0WQ4Nb_XWNUpg1ZRH/s400/Screenshot+2020-03-09+at+12.40.49+PM.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJOZUSx30SkogvIv1pRkvy9Kn99-j7WUJqT3uXxyVEKcv_Vxbqj7q2_9K4EXX2fI2rg1nxgQKSZE-oaf4eFN35h0UQdy3OcQai5wvMfp_ZAHcbGoKEOCtnwfvUd-URmBH9k2OKrOPWp1KQ/s1600/Screenshot+2020-03-09+at+12.50.19+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;222&quot; data-original-width=&quot;269&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJOZUSx30SkogvIv1pRkvy9Kn99-j7WUJqT3uXxyVEKcv_Vxbqj7q2_9K4EXX2fI2rg1nxgQKSZE-oaf4eFN35h0UQdy3OcQai5wvMfp_ZAHcbGoKEOCtnwfvUd-URmBH9k2OKrOPWp1KQ/s1600/Screenshot+2020-03-09+at+12.50.19+PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;As we can see now the Left Pane consists of some new files like:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;1. SceneDelegate.swift&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;2. ContentView.swift&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;On exploring &lt;b&gt;AppDelegate.swift&lt;/b&gt; you will notice it has some methods we are not been aware of in the past like&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;color: #41a1c0;&quot;&gt;application&lt;/span&gt;(&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;_&lt;/span&gt; application: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;UIApplication&lt;/span&gt;, configurationForConnecting connectingSceneSession: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;UISceneSession&lt;/span&gt;, options: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;UIScene&lt;/span&gt;.&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;ConnectionOptions&lt;/span&gt;) -&amp;gt; &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;UISceneConfiguration&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;background-color: #1e2028; color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;color: #41a1c0;&quot;&gt;application&lt;/span&gt;(&lt;span class=&quot;s1&quot; style=&quot;color: #b21889;&quot;&gt;_&lt;/span&gt; application: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;UIApplication&lt;/span&gt;, didDiscardSceneSessions sceneSessions: &lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;Set&lt;/span&gt;&amp;lt;&lt;span class=&quot;s3&quot; style=&quot;color: #00a0be;&quot;&gt;UISceneSession&lt;/span&gt;&amp;gt;)&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;Heading towards the SceneDelegate.swift, this file is the place where we are connecting our scenes to the main window.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ContentView.swift has our scene for now, so the project has automatically linked it to window as shown in the screenshot.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe5D0DkQYGbHnRO0IqS1UH6RHV99Tl520lFlB9KyXfc7wLqP4l4EKRZudvsENsJ40DshjUYXY0XdmlBac0ZF74HJpSO16n4V5JT-GDtLstBxa9VKpGhSVC6ESJoXsYImmFkVMmUoAgtv-K/s1600/Screenshot+2020-03-09+at+12.52.26+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;390&quot; data-original-width=&quot;1006&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe5D0DkQYGbHnRO0IqS1UH6RHV99Tl520lFlB9KyXfc7wLqP4l4EKRZudvsENsJ40DshjUYXY0XdmlBac0ZF74HJpSO16n4V5JT-GDtLstBxa9VKpGhSVC6ESJoXsYImmFkVMmUoAgtv-K/s640/Screenshot+2020-03-09+at+12.52.26+PM.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;Open the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;ContentView.swift file here you can see two&amp;nbsp;&lt;b&gt;&quot;struct&quot;&lt;/b&gt;s. To launch&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Automatic Preview Window&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&amp;nbsp;click on right hand side &lt;b&gt;Adjust Editor Options&lt;/b&gt; button, you can see a dropdown popover, out of this choose Canvas. Canvas will be launched and you may get to see &quot;Automatic preview updating paused&quot; with a button to &lt;b&gt;Resume&lt;/b&gt;. Click this resume button and there we go.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlrG46WAF5Zt60c9lPwn_I9NKL0YInm7GyWFABb_hyphenhyphenHACUkG8YfODy1xxKDG8FrwwIaf9JEnu1voHmUpPIzgAq5LhfW4d-IJenYCSDGswIZtYPDL-9ziTh6mmbbte6hWtSmxPqVhUw1g9C/s1600/Screenshot+2020-03-09+at+12.55.00+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;70&quot; data-original-width=&quot;153&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlrG46WAF5Zt60c9lPwn_I9NKL0YInm7GyWFABb_hyphenhyphenHACUkG8YfODy1xxKDG8FrwwIaf9JEnu1voHmUpPIzgAq5LhfW4d-IJenYCSDGswIZtYPDL-9ziTh6mmbbte6hWtSmxPqVhUw1g9C/s1600/Screenshot+2020-03-09+at+12.55.00+PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_uEJU4Ywvu3AeRY1F5YwrnSQuvk4NclLlLRjTqRNTgvw31wMaALh0NAF2u8slnNc4bjUOnSNhezx5GpstrjB7zLmM4tlicoWe2V4qrzT_l4lc4X38TdX6Ftub6ar2OOOCfDgzSDPd2Vms/s1600/Screenshot+2020-03-09+at+12.55.13+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;175&quot; data-original-width=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_uEJU4Ywvu3AeRY1F5YwrnSQuvk4NclLlLRjTqRNTgvw31wMaALh0NAF2u8slnNc4bjUOnSNhezx5GpstrjB7zLmM4tlicoWe2V4qrzT_l4lc4X38TdX6Ftub6ar2OOOCfDgzSDPd2Vms/s1600/Screenshot+2020-03-09+at+12.55.13+PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAbb-tFMsXAOAhsDXz_p3e9hq85z8i8G6RGwS-p7UD095TQTY7QZ2kPwFvecnh2dz20iwZzZf7SYbBkodGPZC7-_BO1-OuY6lOvgw-cPRP44wG-KjLyCIkoSDI_y08DEvbE_hj0cCls29k/s1600/Screenshot+2020-03-09+at+12.55.21+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;63&quot; data-original-width=&quot;828&quot; height=&quot;48&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAbb-tFMsXAOAhsDXz_p3e9hq85z8i8G6RGwS-p7UD095TQTY7QZ2kPwFvecnh2dz20iwZzZf7SYbBkodGPZC7-_BO1-OuY6lOvgw-cPRP44wG-KjLyCIkoSDI_y08DEvbE_hj0cCls29k/s640/Screenshot+2020-03-09+at+12.55.21+PM.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;Automatic Preview Window is the place where we can get instant reflection of our&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;code.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;By default there is a Label known as &lt;b&gt;Text&lt;/b&gt; in SwiftUI with text &quot;Hello, World!&quot; and you can see it in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;Automatic Preview Window without running your simulator.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;Try changing the text to something else like &quot;This is my SwiftUI Intro App&quot; and the Xcode does the magic to reflects the textual change to the Canvas.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNz0g-lLSlUhmXcY4k3aTANfRJrqQ6qMlIrPo9HggpggSjfbVmHl5Ui34xwJ-TUWsjkpw_xjUGuXqlWXUkOffYm_dWS11GVu5yc0Eux2wsqvSe4_mj_d16sXqD67PG-VLXh_C8cRN3DXTg/s1600/Screenshot+2020-03-09+at+12.41.42+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;885&quot; data-original-width=&quot;1600&quot; height=&quot;353&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNz0g-lLSlUhmXcY4k3aTANfRJrqQ6qMlIrPo9HggpggSjfbVmHl5Ui34xwJ-TUWsjkpw_xjUGuXqlWXUkOffYm_dWS11GVu5yc0Eux2wsqvSe4_mj_d16sXqD67PG-VLXh_C8cRN3DXTg/s640/Screenshot+2020-03-09+at+12.41.42+PM.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/7071251548564321809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/03/intro-to-swiftui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/7071251548564321809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/7071251548564321809'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2020/03/intro-to-swiftui.html' title='Intro to SwiftUI'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ1nLfEeXs7uEV15wzbG9QnlrVSvLxevPTWTTFBakoDIyoiNnfijjbwEhcx5nDj1ZW8FllFaeW_bx4upp67yFXf1iAi-5It97ERfQDno3iDb8CM9sBvHVggjZfv1H0WQ4Nb_XWNUpg1ZRH/s72-c/Screenshot+2020-03-09+at+12.40.49+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-1001034080073384165</id><published>2016-02-03T18:36:00.001+05:30</published><updated>2016-02-03T18:36:04.030+05:30</updated><title type='text'>Communication between iPhone &amp; Watch OS2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
In this tutorial we will cover communication between iPhone and Watch using WatchConnectivity framework (available for Watch OS2 &amp;amp; onwards)&lt;br /&gt;
&lt;br /&gt;
1. Create a Single View Application (you can use other application type too).&lt;br /&gt;
&lt;br /&gt;
2. Click File -&amp;gt; New Target -&amp;gt; WatchKit App (Do not choose WatchKit App for watchOS 1 as it does not support WatchConnectivity framework).&lt;br /&gt;
&lt;br /&gt;
3. So we do have two Targets viz. App and App Watch Extension.&lt;br /&gt;
&lt;br /&gt;
4. Import the WatchConnectivity framework to both the targets.&lt;br /&gt;
&lt;br /&gt;
5. In our App&#39;s ViewController.h file&lt;br /&gt;
&lt;span class=&quot;s1&quot;&gt;#import &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;WatchConnectivity/WatchConnectivity.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
add protocol &amp;lt;WCSessionDelegate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. Now in our App&#39;s ViewController.h file&#39;s viewDidLoad method:&lt;br /&gt;
check if WCSession is supported by our iOS, if yes then do initailize WCSession, set its delegate and activate the session as shown:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ([&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;isSupported&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;]) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; *session = [&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;defaultSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; session.&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;delegate&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [session &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;activateSession&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
7. In order to send data to Watch we need to use updateApplicationContext method of WCSession.&lt;br /&gt;
NSDictionary containing our data to be passed to Watch can be passed to WCSession.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ([&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;isSupported&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;]) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; *session = [&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;defaultSession&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;session.&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;isReachable&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;NSDictionary&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; *applicationDict = [[&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;NSDictionary&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;initWithObjects&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;@[&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;@&quot;Value1&quot;, @&quot;Value2&quot;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;forKeys&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;@[&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;@&quot;Key1&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;@&quot;Key2&quot;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [session &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;updateApplicationContext&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;:applicationDict &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Now in App Watch Extension&#39;s InterfaceController.h file&lt;br /&gt;
&lt;span class=&quot;s1&quot;&gt;#import&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;WatchConnectivity/WatchConnectivity.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
add protocol &amp;lt;WCSessionDelegate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. To get the data passed from iPhone use WCSession delegate method:&lt;br /&gt;








&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;- (&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;)session:(&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;WCSession&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; *)session didReceiveApplicationContext:(&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;NSDictionary&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; *, &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt; *)applicationContext;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;applicationContext object is the NSDictionary passed from the iPhone.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Download Code:&amp;nbsp;&lt;a href=&quot;https://github.com/surajwebo/iPhone-Watch_OS2_Communication/archive/master.zip&quot; target=&quot;_blank&quot;&gt;Here&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/1001034080073384165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2016/02/communication-between-iphone-watch-os2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/1001034080073384165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/1001034080073384165'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2016/02/communication-between-iphone-watch-os2.html' title='Communication between iPhone &amp; Watch OS2'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-6126424768571045358</id><published>2015-07-24T11:53:00.001+05:30</published><updated>2015-07-24T11:53:46.752+05:30</updated><title type='text'>payUmoney Payment Gateway Integration in iOS App (Objective C)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
We have many Payment Gateways available such as &lt;b&gt;Paypal&lt;/b&gt;, &lt;b&gt;CCAvenue&lt;/b&gt;, &lt;b&gt;Zaakpay&lt;/b&gt;, etc.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;payUmoney&lt;/b&gt; is the best Payment Gateway available in India now; according to me.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
I am saying this with my personal experience with&amp;nbsp;&lt;b&gt;payUmoney&lt;/b&gt;&amp;nbsp;Technical Support Team.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
They offer 2.9% Transaction charges without any Enrolment, Setup, AMC or other Hidden charges.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
payUmoney Home Page Link:&amp;nbsp;&lt;a href=&quot;https://www.payumoney.com/&quot;&gt;Home_Page&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;payUmoney Contact Details:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;Address:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;5th Floor, Pearl Towers Plot 51, Sector 32 Gurgaon, 122002&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;Phone:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;0124-6624956,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;0124-6624970&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;Email:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;techsupport@payumoney.com&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;Steps to integrate payUmoney gateway:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
1. Create a new iOS Objective C app in XCode.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
2. Open Main.storyboard in you app.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
3. Add UIWebView and set its Delegate. [Screenshot 1]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
4. Set Frames &amp;amp; Constraints as per design requirements.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
5. Link UIWebView by creating IBOutlet to either .h or .m file. [Screenshot 2]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
6. Signup and create an account on payUmoney. Test Envirnment:&amp;nbsp;&lt;span class=&quot;s3&quot;&gt;&lt;a href=&quot;http://test.payumoney.com/&quot;&gt;http://test.payumoney.com/&lt;/a&gt;&amp;nbsp;or Production Environment:&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;https://www.payumoney.com/&quot;&gt;&lt;span class=&quot;s3&quot;&gt;https://www.payumoney.com/&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
7. Follow below mentioned procedure to complete the registration process:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;&lt;i&gt;&lt;b&gt;Test Environment:&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;Recently, payUmoney has done some modifications in test environment due to which test key-JBZaLc and salt-GQs7yium will not work anymore.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;In order to test the gateway using a test key and salt, kindly follow these steps:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1 - Go on &lt;a href=&quot;http://test.payumoney.com/&quot;&gt;&lt;span class=&quot;s3&quot;&gt;http://test.payumoney.com/&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;2 - Sign up as a merchant - use any of your valid email ids - kindly do not use a random email id.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3 - Use a valid Mobile Number and for Phone/Landline No use your valid mobile number with a preceeding 0. (e.g. Mobile No: 9762159571 so the Landline No: 09762159571)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;4 - Complete the &quot;Business Details&quot;&amp;nbsp; - you may use PAN no. ABCDE1234F and DOB - 01/04/1990&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;5 - Complete &quot;Bank Account Details&quot; (You may use IFSC- ALLA0212632)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;6 - Please leave the bank verification part.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;7 - Go to below mentioned location to get the Test Merchant Id :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Seller Dashboard -&amp;gt; Settings -&amp;gt; My account -&amp;gt; Profile Settings&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;Once you provide your test merchant id, payUmoney will approve it so that you can find your test key and salt at :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;Seller Dashboard -&amp;gt; Settings -&amp;gt; My account -&amp;gt; Merchant Key - Salt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;Production Environment:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;kindly register to &lt;a href=&quot;https://www.payumoney.com/&quot;&gt;&lt;span class=&quot;s3&quot;&gt;https://www.payumoney.com/&lt;/span&gt;&lt;/a&gt; and follow above steps with all your Genuine Bank details, contact numbers &amp;amp; adresses.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;


















































&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;Please note that the Key and Salt for Production server are different from the one we get from Test server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
8. payUmoney requires some mandatory fields to make a web-call:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; txnid&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;key,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;amount,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;productinfo,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;firstname,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;email,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;phone,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;surl,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;furl,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;hash,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;service_provider.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
9. We have to create a Transaction ID which must be unique SHA512 encrypted value.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
10. Take all values from user except txnid, key, surl, furl, &amp;nbsp;hash &amp;amp; service_provider.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
11. Create a NSString by appending all the values in sequence as below:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; *hashValue = [&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;stringWithFormat&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;@&quot;%@|%@|%@|%@|%@|%@|||||||||||%@&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,key,txnid1,amount,productInfo,firstname,email,&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;Salt&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
12. Use SHA512 encryption to hash the&amp;nbsp;&lt;span style=&quot;color: #990000;&quot;&gt;hashValue&lt;/span&gt;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
13. Create a NSDictionary of with all the values we have.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
14. Make a POST type NSMutableURLRequest and pass the required parameters.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
15. Load the NSMutableURLRequest to WebView and we are done.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgdx1XVqz5409fFRORL2iwhVGEDz_Tu1GmhKD_NMDXm2cipBsiS7QrkPDVyyn7gKjh1OjIjOqeJCGcPpmSlTQqpHhXQnSAQKKawOgCdNgZk3xEqpr5_EHiW6YdAAQtd3YeJ8tBHcPH7yH/s1600/Screen+Shot+2015-07-24+at+11.05.21+am.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgdx1XVqz5409fFRORL2iwhVGEDz_Tu1GmhKD_NMDXm2cipBsiS7QrkPDVyyn7gKjh1OjIjOqeJCGcPpmSlTQqpHhXQnSAQKKawOgCdNgZk3xEqpr5_EHiW6YdAAQtd3YeJ8tBHcPH7yH/s640/Screen+Shot+2015-07-24+at+11.05.21+am.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTRnJvH4FH4HaIG6vfBHLmb8nvTefHaHRL2QdDb_wtrsuxIR_ZinP03SF2ew36Ra1BJNfMYtUaOAcXro4rCWTlez-NiIwxVJH9XNx5FAXJErvLyA7Dxt2L6WAI9cw1LHeMpTz1NVyyDE_P/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTRnJvH4FH4HaIG6vfBHLmb8nvTefHaHRL2QdDb_wtrsuxIR_ZinP03SF2ew36Ra1BJNfMYtUaOAcXro4rCWTlez-NiIwxVJH9XNx5FAXJErvLyA7Dxt2L6WAI9cw1LHeMpTz1NVyyDE_P/s640/1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNK6KB-D9C5hY5cvCZfxgVo9Uqc-ysSvSpLFyZgpHCEUDtEAlBoPGZ-AqF16PB_wm8Q2fTsWiAioNxEt0_QIwrzmJLy6LWUz8wIO94_-BaR5jaKpLo-FUOwZocn-p_k6dKgmUYl599g5ri/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;406&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNK6KB-D9C5hY5cvCZfxgVo9Uqc-ysSvSpLFyZgpHCEUDtEAlBoPGZ-AqF16PB_wm8Q2fTsWiAioNxEt0_QIwrzmJLy6LWUz8wIO94_-BaR5jaKpLo-FUOwZocn-p_k6dKgmUYl599g5ri/s640/2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiha4tdvTBR-9l2shEgLWhq25E68ZHEVQJHPDn5-IVJMr6KH5ieNIsHu_kAh5Gr3nVFqA5oZZsEpxemRF-CfUsZLZ8qd579aqH4032LoMhyphenhyphen8teg2IE4eqa3X5mee0GFzqxMGq61v9tGxx_/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;242&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiha4tdvTBR-9l2shEgLWhq25E68ZHEVQJHPDn5-IVJMr6KH5ieNIsHu_kAh5Gr3nVFqA5oZZsEpxemRF-CfUsZLZ8qd579aqH4032LoMhyphenhyphen8teg2IE4eqa3X5mee0GFzqxMGq61v9tGxx_/s640/3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFNykSlkZgVf7ye7XzUEK4QqEf9UWRZgtnCoziiQyHbxgu3gv5ZkZla3BaPWjIaCE9xDavwFqjTuWFmQmI-Q4QhHiv8f3kbsPgwswGE5YvmT30fGtXjUhJz_201rZgyA4a4_BFCc07N0sX/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;384&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFNykSlkZgVf7ye7XzUEK4QqEf9UWRZgtnCoziiQyHbxgu3gv5ZkZla3BaPWjIaCE9xDavwFqjTuWFmQmI-Q4QhHiv8f3kbsPgwswGE5YvmT30fGtXjUhJz_201rZgyA4a4_BFCc07N0sX/s640/4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH4PEinK2pQgtA-MBIzB47ts_fbFALB4BR8s3fntpo7kkmAMUppLOUDB_PzLq0FF8JNNzrUlfXj27BM_vBKTWiWMGZ1S10jVDPM2v1i7rV9te_RwNsMwl5BYxhXJrW_jmlvyhavZtiVLka/s1600/5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH4PEinK2pQgtA-MBIzB47ts_fbFALB4BR8s3fntpo7kkmAMUppLOUDB_PzLq0FF8JNNzrUlfXj27BM_vBKTWiWMGZ1S10jVDPM2v1i7rV9te_RwNsMwl5BYxhXJrW_jmlvyhavZtiVLka/s640/5.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Download code from Github Repo:&amp;nbsp;&lt;a href=&quot;https://github.com/surajwebo/payUmoney-Payment-Gateway/archive/master.zip&quot;&gt;Code&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Special Thanks to:&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/27898349/payumoney-payment-gateway-issue/31580089#31580089&quot;&gt;Stackoverflow_Link&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.payumoney.com/&quot;&gt;payUmoney_Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/6126424768571045358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/07/payumoney-payment-gateway-integration.html#comment-form' title='54 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/6126424768571045358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/6126424768571045358'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/07/payumoney-payment-gateway-integration.html' title='payUmoney Payment Gateway Integration in iOS App (Objective C)'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgdx1XVqz5409fFRORL2iwhVGEDz_Tu1GmhKD_NMDXm2cipBsiS7QrkPDVyyn7gKjh1OjIjOqeJCGcPpmSlTQqpHhXQnSAQKKawOgCdNgZk3xEqpr5_EHiW6YdAAQtd3YeJ8tBHcPH7yH/s72-c/Screen+Shot+2015-07-24+at+11.05.21+am.png" height="72" width="72"/><thr:total>54</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-1807812939171910835</id><published>2015-07-03T16:38:00.001+05:30</published><updated>2015-07-03T16:38:33.027+05:30</updated><title type='text'>Variable declaration in Swift</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Declaration of iVar:&lt;/b&gt;&lt;/h2&gt;
Let&#39;s start with declaring iVars in Swift&lt;br /&gt;
&lt;br /&gt;
In Swift we can declare an iVar using keyword:&lt;br /&gt;
1. &lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;let&lt;/span&gt;&lt;/b&gt; - it declares an immutable iVar&lt;br /&gt;
2. &lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;var&lt;/span&gt;&lt;/b&gt; - it declares a mutable iVar&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;let myLetObject = &quot;My immutable iVar&quot;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
So now i cannot change the value of myLetObject after it is once assigned.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;var myVarObject = &quot;My mutable iVar&quot;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;myVarObject = &quot;Changed the value of iVar&quot;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
I can change its value at any instance.&lt;br /&gt;
&lt;br /&gt;
Some examples of declaring objects:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;let luckyNumber = 9&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;myAge = &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;NSInteger&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(27&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;var myHeight = 5.5&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;let myImage = UIIMage(named:&quot;MyPhoto.png&quot;)&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;var myName: NSString = NSString&quot;string:Suraj Ramjan Mirajkar&quot;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; tableView: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UITableView&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;!&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/1807812939171910835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/07/variable-declaration-in-swift.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/1807812939171910835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/1807812939171910835'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/07/variable-declaration-in-swift.html' title='Variable declaration in Swift'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-3976427379832017155</id><published>2015-06-03T16:28:00.000+05:30</published><updated>2015-06-03T17:28:03.881+05:30</updated><title type='text'>Youtube Video Player </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;To play Youtube video within the app we have 2 ways:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;1.&lt;/b&gt; Open Youtube App (if installed) or launch Safari to play video:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;[[&lt;/span&gt;UIApplication&lt;span class=&quot;s1&quot;&gt; &lt;/span&gt;sharedApplication&lt;span class=&quot;s1&quot;&gt;] &lt;/span&gt;openURL&lt;span class=&quot;s1&quot;&gt;:[&lt;/span&gt;NSURL&lt;span class=&quot;s1&quot;&gt; &lt;/span&gt;URLWithString&lt;span class=&quot;s1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@&quot;http://www.youtube.com/watch?v=Xk1zfQOklJY&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;]];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;In this case we don&#39;t have a choice to bring back the user to our app.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;So we better use the 2nd way.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;2.&lt;/b&gt; Embed Youtube iOS Player Helper:&lt;br /&gt;
I have used&amp;nbsp;&lt;span style=&quot;color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit;&quot;&gt;&lt;b&gt;youtube-ios-player-helper&lt;/b&gt;&amp;nbsp;Version -&amp;nbsp;&lt;b&gt;0.1.3&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;box-sizing: inherit; list-style-position: outside; margin: 0px; padding-left: 40px;&quot;&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
Select&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px;&quot;&gt;YTPlayerView.h&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px;&quot;&gt;YTPlayerView.m&lt;/code&gt;, and the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Assets&lt;/strong&gt;&amp;nbsp;folder from my Github repository&amp;nbsp;&lt;a href=&quot;https://github.com/surajwebo/YoutubePlayer_iOS/archive/master.zip&quot;&gt;&lt;b&gt;CODE&lt;/b&gt;&lt;/a&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
Drag these files and folders into your project. Make sure the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Copy items into destination group’s folder&lt;/strong&gt;&amp;nbsp;option is checked. When dragging the Assets folder, make sure that the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Create Folder References for any added folders&lt;/strong&gt;&amp;nbsp;option is checked.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, &#39;Segoe UI&#39;, Arial, freesans, sans-serif; line-height: 25.6000003814697px;&quot;&gt;Drag a UIView the desired size of your player onto your Storyboard.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, &#39;Segoe UI&#39;, Arial, freesans, sans-serif; line-height: 25.6000003814697px;&quot;&gt;Change the UIView&#39;s class in the Identity Inspector tab to YTPlayerView&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, &#39;Segoe UI&#39;, Arial, freesans, sans-serif; line-height: 25.6000003814697px;&quot;&gt;Import &quot;YTPlayerView.h&quot; in your ViewController.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 25.6000003814697px;&quot;&gt;Add the following property to your ViewController&#39;s header file:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
@interface ViewController : UIViewController &amp;lt;YTPlayerViewDelegate&amp;gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 25.6000003814697px;&quot;&gt;@property(nonatomic, strong) IBOutlet YTPlayerView *playerView;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 25.6000003814697px;&quot;&gt;In Implementation&#39;s viewDidLoad() add following code:&lt;/span&gt;&lt;/span&gt;[self.playerView setDelegate: self];&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 25.6000003814697px;&quot;&gt;[self.playerView loadWithVideoId:@&quot;Xk1zfQOklJY&quot;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
We are done.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 8px; padding: 0px;&quot;&gt;
In case you want to get all the controls to Play, Pause, Stop, Seek to Time do download my code and check it out.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Download -&lt;/b&gt; &lt;a href=&quot;https://github.com/surajwebo/YoutubePlayer_iOS/archive/master.zip&quot; style=&quot;font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;&lt;b&gt;CODE&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below links helped me:&lt;br /&gt;
&lt;a href=&quot;https://developers.google.com/youtube/v3/guides/ios_youtube_helper&quot;&gt;https://developers.google.com/youtube/v3/guides/ios_youtube_helper&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://github.com/surajwebo/YoutubePlayer_iOS/tree/master/YoutubeIniOSApp&quot;&gt;https://github.com/youtube/youtube-ios-player-helper&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/3976427379832017155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/06/youtube-video-player.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3976427379832017155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3976427379832017155'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/06/youtube-video-player.html' title='Youtube Video Player '/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-961414316984193167</id><published>2015-03-13T10:07:00.001+05:30</published><updated>2015-03-13T10:07:53.300+05:30</updated><title type='text'>Check Internet Connectivity Using AFNetworking 2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
I have created&amp;nbsp;&lt;b&gt;NetworkRechabilityMonitor &lt;/b&gt;class to get the Internet Connection status in my app using &lt;b&gt;AFNetworking 2.0&lt;/b&gt; library.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;1.&lt;/i&gt; Create an NSObject class naming&amp;nbsp;&lt;b&gt;NetworkRechabilityMonitor&lt;/b&gt;, add below code in respective Header &amp;amp; Implementation files.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;NetworkRechabilityMonitor.h&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;#import &lt;/span&gt;&amp;lt;Foundation/Foundation.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;@interface&lt;/span&gt; NetworkRechabilityMonitor : &lt;span class=&quot;s3&quot;&gt;NSObject&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;+(&lt;span class=&quot;s2&quot;&gt;void&lt;/span&gt;)startNetworkReachabilityMonitoring;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;+(&lt;span class=&quot;s2&quot;&gt;BOOL&lt;/span&gt;)checkNetworkStatus;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;b&gt;NetworkRechabilityMonitor.m&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;#import &lt;/span&gt;&quot;NetworkRechabilityMonitor.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;@implementation&lt;/span&gt; NetworkRechabilityMonitor&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;#pragma mark - Start Monitoring Network Manager&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;+(&lt;span class=&quot;s2&quot;&gt;void&lt;/span&gt;)startNetworkReachabilityMonitoring {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; [[&lt;/span&gt;AFNetworkReachabilityManager&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;sharedManager&lt;span class=&quot;s3&quot;&gt;] &lt;/span&gt;startMonitoring&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;#pragma mark - Check Internet Network Status&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;+(&lt;span class=&quot;s2&quot;&gt;BOOL&lt;/span&gt;)checkNetworkStatus {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; [&lt;/span&gt;AFNetworkReachabilityManager&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;sharedManager&lt;span class=&quot;s3&quot;&gt;].&lt;/span&gt;reachable&lt;span class=&quot;s3&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;





















&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;@end&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;i&gt;2.&lt;/i&gt; Import the&amp;nbsp;&lt;b&gt;NetworkRechabilityMonitor &lt;/b&gt;in your ViewController class where you want to check the internet status.&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;i&gt;3.&lt;/i&gt; In viewDidLoad method of your ViewController add below line of code:&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;[&lt;/span&gt;NetworkRechabilityMonitor&lt;span class=&quot;s1&quot;&gt; &lt;/span&gt;startNetworkReachabilityMonitoring&lt;span class=&quot;s1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;i&gt;4.&lt;/i&gt; Now in ViewController if i want to check internet status before making an API call add below code:&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ([&lt;/span&gt;NetworkRechabilityMonitor&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;checkNetworkStatus&lt;span class=&quot;s2&quot;&gt;]) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;NSLog&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;@&quot;Connected to Internet&quot;&lt;span class=&quot;s2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Add your code&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;} else {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;







&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: #741b47;&quot;&gt;NSLog&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #741b47;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;@&quot;Not Connected to Internet&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #741b47;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;color: #741b47;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Notify user to connect to Internet&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/961414316984193167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/03/check-internet-connectivity-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/961414316984193167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/961414316984193167'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2015/03/check-internet-connectivity-using.html' title='Check Internet Connectivity Using AFNetworking 2.0'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-1025860457627622128</id><published>2014-11-14T15:24:00.002+05:30</published><updated>2014-11-14T15:24:39.451+05:30</updated><title type='text'>iOS 6 Grouped Style UITableView in iOS 8 App</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I came across a requirement where i have to show&amp;nbsp;&amp;nbsp;iOS 6 grouped style UITableView in iOS8 App.&lt;br /&gt;
So i did some workaround and it really works.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;I added a UITableView on UIViewController (Scene) in UIStoryboard.&lt;/li&gt;
&lt;li&gt;I reduced the width of the UITableView and centre aligned it (eg. UIViewController width - 320px so i take 300px UITableView).&lt;/li&gt;
&lt;li&gt;Add &amp;amp; Import QuartzCore framework.&lt;/li&gt;
&lt;li&gt;In cellForRowAtIndexPath method make the cell layer corner round as per requirement and set masktobounds as shown below.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;







&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;- (&lt;span class=&quot;s1&quot;&gt;UITableViewCell&lt;/span&gt; *)tableView:(&lt;span class=&quot;s1&quot;&gt;UITableView&lt;/span&gt; *)tableView cellForRowAtIndexPath:(&lt;span class=&quot;s1&quot;&gt;NSIndexPath&lt;/span&gt; *)indexPath {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;NSString&lt;/span&gt; *CellIdentifier = &lt;span class=&quot;s3&quot;&gt;@&quot;TableCell&quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;UITableViewCell&lt;/span&gt; *tableCell = [tableView &lt;span class=&quot;s1&quot;&gt;dequeueReusableCellWithIdentifier&lt;/span&gt;:CellIdentifier];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;if&lt;/span&gt; (tableCell&amp;nbsp;== &lt;span class=&quot;s2&quot;&gt;nil&lt;/span&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tableCell&amp;nbsp;= [[&lt;/span&gt;UITableViewCell&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;alloc&lt;span class=&quot;s4&quot;&gt;] &lt;/span&gt;initWithStyle&lt;span class=&quot;s4&quot;&gt;:&lt;/span&gt;UITableViewCellStyleDefault&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;reuseIdentifier&lt;span class=&quot;s4&quot;&gt;:CellIdentifier];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;tableCell.&lt;span class=&quot;s1&quot;&gt;layer&lt;/span&gt;.&lt;span class=&quot;s1&quot;&gt;cornerRadius&lt;/span&gt; = &lt;span class=&quot;s5&quot;&gt;5&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;tableCell.&lt;span class=&quot;s1&quot;&gt;layer&lt;/span&gt;.&lt;span class=&quot;s1&quot;&gt;masksToBounds&lt;/span&gt; = &lt;span class=&quot;s2&quot;&gt;YES&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; [tableCell&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;setBackgroundColor&lt;/span&gt;:&lt;span class=&quot;s6&quot;&gt;[UIColor lightGrayColor]&lt;/span&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/1025860457627622128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/11/ios-6-grouped-style-uitableview-in-ios.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/1025860457627622128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/1025860457627622128'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/11/ios-6-grouped-style-uitableview-in-ios.html' title='iOS 6 Grouped Style UITableView in iOS 8 App'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-8892093748712128292</id><published>2014-04-23T17:38:00.000+05:30</published><updated>2014-04-23T17:38:50.184+05:30</updated><title type='text'>Text to Speech in iOS7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
iOS7 makes Text to Speech really easy and that also in multiple languages.&lt;br /&gt;
iOS7 has added two new classes for Text to Speech functionality:&lt;br /&gt;
1.&amp;nbsp;AVSpeechSynthesizer&lt;br /&gt;
2.&amp;nbsp;AVSpeechUtterance&lt;br /&gt;
&lt;br /&gt;
First Link AVFoundation and AudioToolbox Framework from Application Target -&amp;gt; Build Phases -&amp;gt; Link Binary With Libraries.&lt;br /&gt;
&lt;br /&gt;
Import both frameworks in Header file (.h file)&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#import &amp;lt;AVFoundation/AVFoundation.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#import &amp;lt;AudioToolbox/AudioToolbox.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
add delegate &lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;AVSpeechSynthesizerDelegate&amp;gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
In implementation file (.m file)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3d85c6;&quot;&gt; AVSpeechSynthesizer *speechSynthesizer = [[AVSpeechSynthesizer alloc] init];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; AVSpeechUtterance *speechUtterance = [AVSpeechUtterance speechUtteranceWithString:@&quot;Welcome to iOS App.&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;speechUtterance&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;speechUtterance&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@&quot;en-US&quot;]; // language&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;speechSynthesizer&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;speakUtterance:&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;speechUtterance&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
By adding the above code you can add text to speech functionality to your iOS7 app.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/8892093748712128292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/04/text-to-speech-in-ios7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8892093748712128292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8892093748712128292'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/04/text-to-speech-in-ios7.html' title='Text to Speech in iOS7'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-7256082130740150764</id><published>2014-04-23T17:21:00.001+05:30</published><updated>2014-04-23T17:21:45.935+05:30</updated><title type='text'>Display HTML in NSAttributedString in iOS7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
iOS7 has really added some best things like displaying HTML in&amp;nbsp;NSAttributedString.&lt;br /&gt;
Suppose in a case you want to display some HTML in your UITextView from any website.&lt;br /&gt;
Just pass the HTML to NSAttributedString and set this attributed string to the UITextView and that&#39;s it, you are done.&lt;br /&gt;
&lt;br /&gt;
In below snippet i have passed the html string from my blog site to NSAttributedString and this NSAttributedString is set to UITextView.&lt;br /&gt;
Now the html from my blog site will be displayed in the UITextView along with clickable links.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; NSString *strHtml = [NSString stringWithContentsOfURL:[NSURL &amp;nbsp; URLWithString:@&quot;http://objectivecwithsuraj.blogspot.in/&quot;] encoding:NSUTF8StringEncoding error:nil];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; NSAttributedString *attrStrWithHtml = [[NSAttributedString alloc]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;initWithData:[strHtml&amp;nbsp;dataUsingEncoding:NSUTF8StringEncoding]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;documentAttributes:nil error:nil];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; UITextView *textView = [[UITextView alloc] initWithFrame:self.view.frame];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; [textView setAttributedText:&amp;nbsp;attrStrWithHtml];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; [textView setDataDetectorTypes:UIDataDetectorTypeLink];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; [textView setEditable:NO];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; [self.view addSubview:textView];&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/7256082130740150764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/04/display-html-in-nsattributedstring-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/7256082130740150764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/7256082130740150764'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/04/display-html-in-nsattributedstring-in.html' title='Display HTML in NSAttributedString in iOS7'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-8661568482208773749</id><published>2014-04-09T15:23:00.000+05:30</published><updated>2014-04-09T15:25:44.945+05:30</updated><title type='text'>Calculating Height of UITextView in iOS7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
Many times in application we need to calculate height of UITextView to make it grow and shrink according to the text contained within it.&lt;br /&gt;
&lt;br /&gt;
Now many of you will say calculating height of UITextView is not a big deal.&lt;br /&gt;
&lt;br /&gt;
Yes its true for iOS6 and below version. But not true from iOS7 and higher.&lt;br /&gt;
&lt;br /&gt;
In iOS6 we can get height of a &lt;b&gt;UITextView&lt;/b&gt; simply using the &lt;b&gt;contentSize&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&lt;br /&gt;&amp;nbsp; [myTextView setText:@&quot;here goes my text&quot;];&lt;br /&gt;&lt;br /&gt;&amp;nbsp; CGFloat heightOfTextView = myTextView.contentSize.height;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In iOS7 may be it&#39;s a bug or due to deprecation, contentSize does not provide you the accurate height of the UITextView.&lt;br /&gt;
&lt;br /&gt;
So below is the code snippet i used in my application for getting the height of UITextView:&lt;br /&gt;
&lt;br /&gt;
Just set text NSString to UITextView and call this method sending UITextView as parameter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; [myTextView setText:@&quot;here goes my text&quot;];&lt;br /&gt;&lt;br /&gt;&amp;nbsp; [self measureHeightOfUITextView: myTextView];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- (CGFloat)measureHeightOfUITextView:@&quot;here goes my text&quot;];​(UITextView *)textView&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (floor(NSFoundationVersionNumber) &amp;gt; NSFoundationVersionNumber_iOS_6_1)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This is the code for iOS 7. contentSize no longer returns the correct value, so&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // we have to calculate it.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGRect frame = textView.bounds;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Take account of the padding added around the text.​&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UIEdgeInsets textContainerInsets = textView.textContainerInset;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UIEdgeInsets contentInsets = textView.contentInset;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGFloat leftRightPadding = textContainerInsets.left + textContainerInsets.right + textView.textContainer.lineFragmentPadding * 2 + contentInsets.left + contentInsets.right;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGFloat topBottomPadding = textContainerInsets.top + textContainerInsets.bottom + contentInsets.top + contentInsets.bottom;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frame.size.width -= leftRightPadding;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frame.size.height -= topBottomPadding;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *textToMeasure = textView.text;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ([textToMeasure hasSuffix:@&quot;\n&quot;])&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textToMeasure = [NSString stringWithFormat:@&quot;%@-&quot;, textView.text];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // NSString class method: boundingRectWithSize:options:attributes:context is&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // available only on ios7.0 sdk.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [paragraphStyle setLineBreakMode:NSLineBreakByWordWrapping];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *attributes = @{ NSFontAttributeName: textView.font, NSParagraphStyleAttributeName : paragraphStyle };&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGRect size = [textToMeasure boundingRectWithSize:CGSizeMake(CGRectGetWidth(frame), MAXFLOAT)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options:NSStringDrawingUsesLineFragmentOrigin&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attributes:attributes&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; context:nil];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGFloat measuredHeight = ceilf(CGRectGetHeight(size) + topBottomPadding);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return measuredHeight;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return textView.contentSize.height;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I got help from below links for above code snippet:&lt;br /&gt;
&lt;a href=&quot;http://trio-hasim.blogspot.in/2014/01/get-uitextview-content-size-in-ios7.html&quot; target=&quot;_blank&quot;&gt;Link 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/19046969/uitextview-content-size-different-in-ios7&quot; target=&quot;_blank&quot;&gt;Link 2&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/8661568482208773749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/04/calculating-of-height-of-uitextview-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8661568482208773749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8661568482208773749'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/04/calculating-of-height-of-uitextview-in.html' title='Calculating Height of UITextView in iOS7'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-3531960361869399089</id><published>2014-03-26T16:56:00.000+05:30</published><updated>2014-03-26T16:56:22.345+05:30</updated><title type='text'>Hyperlinks in iOS App by detecting Links, Phone Number, Address and CalendarEvent in UITextView</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In many scenarios we have to detect Links(URLs) and Phone Numbers from given NSString and make it similar to hyperlink in HTML.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Suppose you have a string with multiple url&#39;s and you want to make it clickable, so as to be able to open it in Safari browser.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In below code i have taken a string which consists of two url&#39;s and i want to make it clickable.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;So i take a UITextView &quot;txtViewClickableHyperLink&quot; and assigned the NSString &quot;strText&quot; to it.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now i have used a magic line to setDataDetector of UITextView, this line has power to recognise my url.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;By changing type of DataDetector we can recognise:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UIDataDetectorTypeLink &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- URL (Link)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UIDataDetectorTypePhoneNumber &amp;nbsp; - Phone Number&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UIDataDetectorTypeAddress &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Address&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UIDataDetectorTypeCalendarEvent &amp;nbsp; - Calendar Event&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UIDataDetectorTypeAll &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- Detects all types&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;NSString *strText = [NSString stringWithFormat: @&quot;&lt;/span&gt;Hey this is my blog: http://objectivecwithsuraj.blogspot.in/ which is hosted on https://www.blogger.com/. This is my blog here is share my experiences with all of you. So it can help others as well as me in future.&amp;nbsp;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;UITextView *txtViewClickableHyperLink = [[UITextView alloc] init];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;[txtViewClickableHyperLink setFrame:CGRectMake(X_COORDINATE, Y_COORDINATE, WIDTH, HEIGHT)];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;[txtViewClickableHyperLink setEditable:NO];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;[txtViewClickableHyperLink setDataDetectorTypes:UIDataDetectorTypeLink];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;[txtViewClickableHyperLink setText:strText];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;[self.view addSubview:txtViewClickableHyperLink];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now we can detect url, phone number , address and make it clickable using a UITextView in iPhone App.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sample Code :&amp;nbsp;&lt;a href=&quot;https://github.com/surajwebo/HyperlinksINiOSApp/archive/master.zip&quot;&gt;HERE&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNtn6-ClcqZuUEW-xyWMvp8EEhFdnrM5edTUD-GWabzahiTAUiK7L4pO0smErfQbYpcA2R3AJ6M3mNTrAQ2xSxNDox18PtcXRJrxA7K_F4SrMLzeema_ZlrDyFKK89dsXod7ocNlJfZoOF/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.15+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNtn6-ClcqZuUEW-xyWMvp8EEhFdnrM5edTUD-GWabzahiTAUiK7L4pO0smErfQbYpcA2R3AJ6M3mNTrAQ2xSxNDox18PtcXRJrxA7K_F4SrMLzeema_ZlrDyFKK89dsXod7ocNlJfZoOF/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.15+PM.png&quot; height=&quot;400&quot; width=&quot;225&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOveX6D8Wi3r7BZfanaVt_3MzMgS6xNiuQwvfPJ-_vbpHPx-MmTC3km5mPRmDpN2ZMCYhZVyadDHGQr8iCE0mz9aZpiv0TCvXu22NhIVKHkzg7NZ93LS4ZaC_A1ddMMGAO_G_ppFos6Q2N/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.21+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOveX6D8Wi3r7BZfanaVt_3MzMgS6xNiuQwvfPJ-_vbpHPx-MmTC3km5mPRmDpN2ZMCYhZVyadDHGQr8iCE0mz9aZpiv0TCvXu22NhIVKHkzg7NZ93LS4ZaC_A1ddMMGAO_G_ppFos6Q2N/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.21+PM.png&quot; height=&quot;400&quot; width=&quot;225&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhyphenhyphen_qvyuWtipHVD5j-FqAFpXxTqCzQTczJ0soH8C360b9tLSmhrUfEFbcKZYYBhWKimb39jOkZDjyyY4IINDZkGfs8B8S5U6Fi7QkCVdxCZT4c5xvsLXboKOQ3nbYJhd_wWHeYY1UU5V4/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.24+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhyphenhyphen_qvyuWtipHVD5j-FqAFpXxTqCzQTczJ0soH8C360b9tLSmhrUfEFbcKZYYBhWKimb39jOkZDjyyY4IINDZkGfs8B8S5U6Fi7QkCVdxCZT4c5xvsLXboKOQ3nbYJhd_wWHeYY1UU5V4/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.24+PM.png&quot; height=&quot;400&quot; width=&quot;225&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCdz7-dKdlo4IqBrPjsov6mJMmYMwSozxZYV85Unqir8ZFZN65SYPkJZfDWYD0PgLPt5cxqSU48axRrN-p73T990IPtROchHdHFXc7rgMe7Bc-ebMmDwqWKLOgyXOC1uYEwDNJP7pEU87o/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.04.03+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCdz7-dKdlo4IqBrPjsov6mJMmYMwSozxZYV85Unqir8ZFZN65SYPkJZfDWYD0PgLPt5cxqSU48axRrN-p73T990IPtROchHdHFXc7rgMe7Bc-ebMmDwqWKLOgyXOC1uYEwDNJP7pEU87o/s1600/iOS+Simulator+Screen+shot+26-Mar-2014+4.04.03+PM.png&quot; height=&quot;400&quot; width=&quot;225&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;goog_2086339163&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_2086339164&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/3531960361869399089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/03/hyperlinks-in-ios-app-by-detecting.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3531960361869399089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3531960361869399089'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/03/hyperlinks-in-ios-app-by-detecting.html' title='Hyperlinks in iOS App by detecting Links, Phone Number, Address and CalendarEvent in UITextView'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNtn6-ClcqZuUEW-xyWMvp8EEhFdnrM5edTUD-GWabzahiTAUiK7L4pO0smErfQbYpcA2R3AJ6M3mNTrAQ2xSxNDox18PtcXRJrxA7K_F4SrMLzeema_ZlrDyFKK89dsXod7ocNlJfZoOF/s72-c/iOS+Simulator+Screen+shot+26-Mar-2014+4.03.15+PM.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-3138477825671466599</id><published>2014-03-21T17:51:00.001+05:30</published><updated>2014-03-21T17:51:46.563+05:30</updated><title type='text'>UIPanGestureRecognizer to create Screen similar to Notification Center</title><content type='html'>&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;In my application i wanted a Screen similar to the Notification Center of the iPhone.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;Where user can navigate through 3 screens using swipe gesture and also by selecting the UISegmentedControl index.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;So i have figured out below code.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;-(void)viewDidLoad {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;[super viewDidLoad];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;// I have added a ScrollView on Xib file of width 960px here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;// added content(UIControls) required on first screen at 0px to 320px.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;// added content(UIControls) required on second screen at 320px to 640px.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;// added content(UIControls) required on third screen at 640px to 960px.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;// I have added a UISegmentedControl on Xib file and set an action: - (IBAction)changeTab:(id)sender&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;// Add PangestureRecognizer to view&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(swipeThroughTabs:)];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[panRecognizer setMinimumNumberOfTouches:1];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[panRecognizer setMaximumNumberOfTouches:1];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[panRecognizer setDelegate:self];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[self.view addGestureRecognizer:panRecognizer];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;-(void)swipeThroughTabs:(id)sender {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[[[(UITapGestureRecognizer*)sender view] layer] removeAllAnimations];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;CGPoint velocity = [(UIPanGestureRecognizer*)sender velocityInView:[sender view]];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;if ([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateEnded) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (velocity.x &amp;lt; 0) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (segmentedControlForTab.selectedSegmentIndex == 0) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[self changeTabManually:1];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else if (segmentedControlForTab.selectedSegmentIndex == 1) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[self changeTabManually:2];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (segmentedControlForTab.selectedSegmentIndex == 2) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[self changeTabManually:1];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else if (segmentedControlForTab.selectedSegmentIndex == 1) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[self changeTabManually:0];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;-(void)changeTabManually:(NSInteger )selectedIndex {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[self hideKeyboard];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[UIView animateWithDuration:0.5&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;delay:0.0&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;options:UIViewAnimationOptionCurveEaseIn&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; animations:^ {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [segmentedControlForTab setSelectedSegmentIndex:selectedIndex];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CGRect frameOfScrollView = scrollViewSettingPage.frame;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (selectedIndex) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 0: {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameOfScrollView.origin.x = 0;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrollViewSettingPage.frame = frameOfScrollView;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 1: {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameOfScrollView.origin.x = -320;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrollViewSettingPage.frame = frameOfScrollView;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 2: {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameOfScrollView.origin.x = -640;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrollViewSettingPage.frame = frameOfScrollView;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; completion:^(BOOL finished) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;- (IBAction)changeTab:(id)sender {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[self hideKeyboard];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;UISegmentedControl *segmentedControl = (id)sender;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp;[UIView animateWithDuration:0.5&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;delay:0.0&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;options:UIViewAnimationOptionCurveEaseIn&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; animations:^ {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CGRect frameOfScrollView = scrollViewSettingPage.frame;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (segmentedControl.selectedSegmentIndex) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 0: {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameOfScrollView.origin.x = 0;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrollViewSettingPage.frame = frameOfScrollView;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 1: {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameOfScrollView.origin.x = -320;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrollViewSettingPage.frame = frameOfScrollView;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 2: {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameOfScrollView.origin.x = -640;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrollViewSettingPage.frame = frameOfScrollView;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; completion:^(BOOL finished) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;s2&quot; style=&quot;margin-top: 0px; margin-bottom: 0px;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&lt;span class=&quot;bumpedFont20&quot; style=&quot;-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi69cTuA6J2Ev7yWAGtGY0EgYR2-WVkZ873JTshpMEI8uD-_l79P54PG_0VnxDLstqpaM4hLwPsa5hI0PDfILOJnUra_zG8ReOmQabo0HbliDjjoneTuNqADjLLjtVnP2ClQ0VmmUfX9G9y/s640/blogger-image--75167845.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi69cTuA6J2Ev7yWAGtGY0EgYR2-WVkZ873JTshpMEI8uD-_l79P54PG_0VnxDLstqpaM4hLwPsa5hI0PDfILOJnUra_zG8ReOmQabo0HbliDjjoneTuNqADjLLjtVnP2ClQ0VmmUfX9G9y/s640/blogger-image--75167845.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU12begnMaESZ5ZDAqY9ghLSa8lHGjA8x6A8-4uAjWfMaq2_ttKbBnKuPqjrueOrl5P90Ua1vl4o2-St_XfCNARq_1_eE0Qevnxeqll02xziy3hrPk1xNtg3Poh7M06-NPfY2XF3vvSPyB/s640/blogger-image-23472704.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU12begnMaESZ5ZDAqY9ghLSa8lHGjA8x6A8-4uAjWfMaq2_ttKbBnKuPqjrueOrl5P90Ua1vl4o2-St_XfCNARq_1_eE0Qevnxeqll02xziy3hrPk1xNtg3Poh7M06-NPfY2XF3vvSPyB/s640/blogger-image-23472704.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3AajT4lxm0tEiNZVlEBqjjvgh94O2e3VyDB3T_CmbpcKYnul-fg-cM1SWHTMe4dv7VycNO_I4kcbezmvrIzQ0IDwkABFGaKYPxSi8_TCDIouFYXFk-CL7R3lyjvgVFdluA16Qa3AlQjwy/s640/blogger-image-599507516.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3AajT4lxm0tEiNZVlEBqjjvgh94O2e3VyDB3T_CmbpcKYnul-fg-cM1SWHTMe4dv7VycNO_I4kcbezmvrIzQ0IDwkABFGaKYPxSi8_TCDIouFYXFk-CL7R3lyjvgVFdluA16Qa3AlQjwy/s640/blogger-image-599507516.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/3138477825671466599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/03/uipangesturerecognizer-to-create-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3138477825671466599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/3138477825671466599'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/03/uipangesturerecognizer-to-create-screen.html' title='UIPanGestureRecognizer to create Screen similar to Notification Center'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi69cTuA6J2Ev7yWAGtGY0EgYR2-WVkZ873JTshpMEI8uD-_l79P54PG_0VnxDLstqpaM4hLwPsa5hI0PDfILOJnUra_zG8ReOmQabo0HbliDjjoneTuNqADjLLjtVnP2ClQ0VmmUfX9G9y/s72-c/blogger-image--75167845.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-4105785711871528652</id><published>2014-02-12T16:11:00.000+05:30</published><updated>2014-10-20T12:16:25.279+05:30</updated><title type='text'>Placeholder text in UITextView iOS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
As we all know UITextView does not have a Placeholder unlike a UITextField.&lt;br /&gt;
So it is really a painful job to have a placeholder text in a UITextView.&lt;br /&gt;
I got stuck on the same issue and did some work around.&lt;br /&gt;
This trick will make you think that you are actually having a placeholder text inside a UITextView.&lt;br /&gt;
&lt;br /&gt;
So here we go:&lt;br /&gt;
1. Place a UILabel on nib (xib) file at the position where you want UITextView.&lt;br /&gt;
2. Now set text what you want on the placeholder and change it text color to lightGraycolor.&lt;br /&gt;
3. Take a UITextView and place it above the UILabel and set its background color to clearcolor.&lt;br /&gt;
4. It will appear as a placeholder inside UITextView.&lt;br /&gt;
5. &lt;b&gt;Set delegates &lt;/b&gt;of UITextView as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;In Header file:&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;#import &lt;/span&gt;&amp;lt;UIKit/UIKit.h&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;@interface&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; LoginViewController : &lt;/span&gt;UIViewController&lt;span class=&quot;s3&quot;&gt; &amp;lt;&lt;/span&gt;UITextViewDelegate&lt;span class=&quot;s3&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;In Implementation file:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
- (&lt;span class=&quot;s1&quot;&gt;void&lt;/span&gt;)viewDidLoad {&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;viewDidLoad&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; [myTextView setDelegate:self];&lt;/span&gt;&lt;/div&gt;
}&lt;br /&gt;
&lt;br /&gt;
6. Take textViewDidChange delegate method of UITextView.&lt;br /&gt;
6. Here set UILabel to hidden YES and set background color of UITextView to white when UITextView does not have text.&lt;br /&gt;
7. And in else condition set UILabel to hidden NO and set background color of UITextView to clearcolor when UITextView.&lt;br /&gt;
&lt;br /&gt;
- (void)textViewDidChange:(UITextView *)textView {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Enable and disable lblPlaceHolderText&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ([textView.text length] &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [textView setBackgroundColor:[UIColor whiteColor]];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [lblPlaceHolderText setHidden:YES];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [textView setBackgroundColor:[UIColor clearColor]];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [lblPlaceHolderText setHidden:NO];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code:&amp;nbsp;&lt;a href=&quot;https://github.com/surajwebo/Placeholder_In_UITextView/archive/master.zip&quot;&gt;HERE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_1170835394&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1170835395&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Image: Before typing the placeholder is visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaGJYSqAef1Jep4WYxKvDPt5l3jP2geYvtXkqU83j92tXcqzAyXebQvgAIq3sv_aSRg0iFlHdp94tiFYb2tHRq3mgHRvzCyu_NY19JZtcF7TBLUSrK2BK56-q6Gu1MC1KO8tsgYakCsBn_/s1600/Before+typing.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaGJYSqAef1Jep4WYxKvDPt5l3jP2geYvtXkqU83j92tXcqzAyXebQvgAIq3sv_aSRg0iFlHdp94tiFYb2tHRq3mgHRvzCyu_NY19JZtcF7TBLUSrK2BK56-q6Gu1MC1KO8tsgYakCsBn_/s1600/Before+typing.png&quot; height=&quot;640&quot; width=&quot;360&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Image: After typing placeholder hides.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9iAmcuRWkmhIW150Gxi2-YeqMDzRkl84qVGu87EvSLAh7tbTY0DRNB-mzEpqvbII9CCanj-tTqqZjUfVyi5XcUCECocDY4pPoMmob9PafiE4lNYMcmBSKGUBvvjT7LRjoGwQSfi9wZC1x/s1600/After+typing.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9iAmcuRWkmhIW150Gxi2-YeqMDzRkl84qVGu87EvSLAh7tbTY0DRNB-mzEpqvbII9CCanj-tTqqZjUfVyi5XcUCECocDY4pPoMmob9PafiE4lNYMcmBSKGUBvvjT7LRjoGwQSfi9wZC1x/s1600/After+typing.png&quot; height=&quot;640&quot; width=&quot;360&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/4105785711871528652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/02/placeholder-text-in-uitextview-ios.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/4105785711871528652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/4105785711871528652'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/02/placeholder-text-in-uitextview-ios.html' title='Placeholder text in UITextView iOS'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaGJYSqAef1Jep4WYxKvDPt5l3jP2geYvtXkqU83j92tXcqzAyXebQvgAIq3sv_aSRg0iFlHdp94tiFYb2tHRq3mgHRvzCyu_NY19JZtcF7TBLUSrK2BK56-q6Gu1MC1KO8tsgYakCsBn_/s72-c/Before+typing.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7653192557512741265.post-8326825238668088771</id><published>2014-01-23T18:37:00.003+05:30</published><updated>2014-01-23T18:39:59.229+05:30</updated><title type='text'>Unique Identifier UUID - iOS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;UDID&lt;/b&gt; is a hash value composed from various hardware identifiers such as the device serial number.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;It is unique for each device.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;The UDID is independent of the device name, SIM card.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;It is really easy to get it from the device&amp;nbsp;programmatically:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;NSString *uuid = &amp;nbsp;[[UIDevice currentDevice] uniqueIdentifier];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;But&amp;nbsp;UDID is no longer available onwards iOS 6 due to security / privacy reasons.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;UDID is deprecated by Apple; developers can not make use of it in any iOS application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;So what now?&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;How can we identify the device?&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;I found many solutions on searching over internet like&amp;nbsp;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;identifierForVendor or&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;advertisingIdentifier or generate our own &lt;b&gt;UUID&lt;/b&gt; (store &amp;amp; persist it on your own).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;Many examples show how to generate UUID and store it in NSUserDefault:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;


&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;-(&lt;span class=&quot;s1&quot;&gt;NSString&lt;/span&gt; *)generateUUID {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;NSString&lt;/span&gt; *CFUUID = &lt;span class=&quot;s2&quot;&gt;nil&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; ([[&lt;/span&gt;NSUserDefaults&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;standardUserDefaults&lt;span class=&quot;s3&quot;&gt;] &lt;/span&gt;valueForKey&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;UUID&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;] == &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;CFUUIDRef&lt;span class=&quot;s3&quot;&gt; uuid = &lt;/span&gt;CFUUIDCreate&lt;span class=&quot;s3&quot;&gt;(&lt;/span&gt;kCFAllocatorDefault&lt;span class=&quot;s3&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CFUUID = (&lt;/span&gt;NSString&lt;span class=&quot;s3&quot;&gt; *)&lt;/span&gt;CFBridgingRelease&lt;span class=&quot;s3&quot;&gt;(&lt;/span&gt;CFUUIDCreateString&lt;span class=&quot;s3&quot;&gt;(&lt;/span&gt;kCFAllocatorDefault&lt;span class=&quot;s3&quot;&gt;, uuid));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [[&lt;/span&gt;NSUserDefaults&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;standardUserDefaults&lt;span class=&quot;s3&quot;&gt;] &lt;/span&gt;setValue&lt;span class=&quot;s3&quot;&gt;:CFUUID &lt;/span&gt;forKey&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;UUID&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [[&lt;/span&gt;NSUserDefaults&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;standardUserDefaults&lt;span class=&quot;s3&quot;&gt;] &lt;/span&gt;synchronize&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;span class=&quot;s2&quot;&gt;else&lt;/span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CFUUID = [[&lt;/span&gt;NSUserDefaults&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;standardUserDefaults&lt;span class=&quot;s3&quot;&gt;] &lt;/span&gt;valueForKey&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;UUID&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;color: #741b47; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;But if you store the UUID in &lt;b&gt;NSUserDefaults&lt;/b&gt; you would loose it as soon as the app gets uninstalled from the device.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;So the better idea is to store it in &lt;b&gt;Keychain&lt;/b&gt;. In case the app is uninstalled Keychain will preserve the UUID and on next installation we can fetch it from there.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;Create &amp;amp; Store UUID in Keychain:&amp;nbsp;&lt;a href=&quot;https://github.com/surajwebo/StoreUUIDInKeychain/archive/master.zip&quot;&gt;Source Code&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://objectivecwithsuraj.blogspot.com/feeds/8326825238668088771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/01/unique-identifier-uuid-ios.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8326825238668088771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7653192557512741265/posts/default/8326825238668088771'/><link rel='alternate' type='text/html' href='http://objectivecwithsuraj.blogspot.com/2014/01/unique-identifier-uuid-ios.html' title='Unique Identifier UUID - iOS'/><author><name>Suraj Ramjan Mirajkar</name><uri>http://www.blogger.com/profile/01397355167702446258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV_OEslAKhGe27AxgokqTiEjZZqldRWfrYRMVdXYS4BuDPRp1BKu18rKmkEsoBiuOvyJcieUe7TCuduhfDbAwfmkg7TgwsZ6lVLR5A_vNYIkHRtpnyh0KJ84m8QKi9-2oUlRQCsE5qrpMkOZr0yG-A1M9g0Cqfdb-GIsRrSBXTu7jlKA/s1600/Golden_suit_profile_pic_1.png'/></author><thr:total>5</thr:total></entry></feed>