<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jaydeep Vora on Medium]]></title>
        <description><![CDATA[Stories by Jaydeep Vora on Medium]]></description>
        <link>https://medium.com/@jaydeepvora?source=rss-d4c141ee7a26------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZiAmuxHXVWT4qF4KgvEl-g.png</url>
            <title>Stories by Jaydeep Vora on Medium</title>
            <link>https://medium.com/@jaydeepvora?source=rss-d4c141ee7a26------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:47:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jaydeepvora/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Async-Await in Swift 5.5]]></title>
            <link>https://medium.com/swlh/async-await-in-swift-5-5-75c3a38bc9c3?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/75c3a38bc9c3</guid>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[async]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Sun, 30 May 2021 16:01:15 GMT</pubDate>
            <atom:updated>2021-05-30T16:01:15.621Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Async Await in Swift, Jaydeep Vora" src="https://cdn-images-1.medium.com/max/1024/1*InLWByc6CNU5QKBakY4tTQ.png" /></figure><p>Swift supports a good way to handle asynchronous programming, and the most useful and easy way among them is <strong>Closure, </strong>but managing the closure in an effective way is another headache for the developer</p><p>To manage a Closure we have to also manage the memory references, also it makes duplication of memory when you define closure inside a function. and slow down the performance. And also <strong>Completion handlers</strong> are commonly used in Swift code to allow us to send back values after a function returns, but they had tricky syntax as you’ll see.</p><p>But Swift 5.5 introduces a new paradigm for async programming called <strong>async-await</strong> mechanism. Many other programming languages like Dart, JavaScript support this mechanism. And the same we get in Swift. So it’s a very new approach and syntaxes in Swift.</p><p>Using async-await approach, allows us to run complex asynchronous code almost as if it were synchronous.</p><p>Here we will understand async-await using one example, in that we will write some async code using closure and after that, we will implement the same problem with async-await mechanism.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3d1ad5f1c0c2bd05363e0fad13e8c90/href">https://medium.com/media/c3d1ad5f1c0c2bd05363e0fad13e8c90/href</a></iframe><p>The first function fetches student scores from the server and provides a completion to handle, the second function finds an average of scores, and the third function uploads an average result to the server again.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a78ee94724579578103afe1f9a4cd3a/href">https://medium.com/media/7a78ee94724579578103afe1f9a4cd3a/href</a></iframe><p>When we call this into code, we need to call them one by one in a chain, providing completion closures for each one to continue the chain, like this:</p><p>Now we will try the same in async-await programming. So that we can understand how it simple to implement async-await.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87aa4393c55fa608660d772e1be28c71/href">https://medium.com/media/87aa4393c55fa608660d772e1be28c71/href</a></iframe><p>As you can see there is <strong>async</strong> keyword is introduced to indicate the function as asynchronous. And all the completion handler is replaced with normal return type in swift syntax.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/287db722f6a03216e22333b57b505f7f/href">https://medium.com/media/287db722f6a03216e22333b57b505f7f/href</a></iframe><p>And now you can call this function like this to get the results. To wait for the result from the async process. <strong>await </strong>keyword is used.</p><p>Why this is important in the coming days, Because when we doing the asynchronous process. There are many reasons to getting fail, and error handling in async programming is more complicated.</p><p>So if we use this async-await we can return errors and results as we did till now while returning from the function.</p><p>That’s all, If you like the story please like and follow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75c3a38bc9c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/async-await-in-swift-5-5-75c3a38bc9c3">Async-Await in Swift 5.5</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configurable iOS 14 Widget using WidgetKit]]></title>
            <link>https://medium.com/swlh/configurable-ios-14-widget-using-widgetkit-19e1075c0093?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e1075c0093</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[widgetkit]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios-14]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Mon, 05 Oct 2020 13:49:52 GMT</pubDate>
            <atom:updated>2020-10-15T06:29:55.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HHDe73dgaKCQ1pNpBy9uQ.png" /></figure><p>In WWDC 2020, New enhancements are introduced in iOS 14, And we got the intro with WidgetKit also.</p><p>iOS 14 Widgets have been redesigned to be more beautiful and data-rich, so they can provide even more utility throughout your day. also Widgets brings a fresh look to the things you do most often, making them easier than ever.</p><p>WidgetKit is built purely using SwiftUI, It’s important to know that WidgetKit isn’t meant to build mini-apps. It’s a part of our application and we can only <br><strong>Link</strong> widget to some part of the app.</p><h3>Today’s Goal</h3><ol><li>Build a configurable widget in which users can select 2 currency to get the Exchange rate.</li><li>We will use <a href="https://api.exchangeratesapi.io/"><strong>https://api.exchangeratesapi.io/</strong></a> API ad pass use currencies to get the currency data</li><li>We will create a responsive widget to support multiple families of Widgets <strong>(i.e systemSmall, systemMedium, systemLarge)</strong></li></ol><p>To create our first widget, Go to <strong>File → New → Target</strong> and select the Widget Extension template. Make sure you check “<strong>Include Configuration Intent</strong>” as we are going to make Configurable Widget</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*bl4ZrdJb7gSf3Dl03PfXtQ.png" /><figcaption>Create widget target</figcaption></figure><p>By performing the above action, it will create the Widget in the root folder. which contains some SwiftUI code. also, we’ll apply some folder structure to manage our <strong>View, Model &amp; Service</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*tFy6YYO2yjDKc2Jo4p4SOg.png" /><figcaption>Folder Structure</figcaption></figure><p>Now first we will create our <strong>Custom Intent</strong> to accept the input from and make a customizable Widget. So first we create an Int Enum type of input as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*6B8OUhOHApe2_N7IkGuHOA.png" /><figcaption>Custom Enum intent type</figcaption></figure><p>Now we will create the 2 variables(from and to) of <strong>Currency</strong> Type to make it configurable, So the user can select the <strong>From</strong> and <strong>To</strong> currencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*QttLuKAFASjIQ5Llzxaeig.png" /></figure><p>i.e If the User selects <strong>from</strong> currency as USD and <strong>to</strong> currency as INR. they will get a result between these currencies.</p><p>So our setup is done. Next, we will move to our coding part.</p><p>First, we will create our <strong>ExchangeRate </strong>model to hold the data between API and View. Go to <strong>Currency Widget → Model </strong>and create <strong>ExchangeRate.swift </strong>file</p><p>As we have a dynamic keys in response like INR, USD, GBP, etc. So we’ll use Dynamic Coding Keys<strong> </strong>in <strong>Codable</strong> to parse this response.</p><pre>{<br>  &quot;rates&quot;: {<br>    &quot;INR&quot;: 73.3482523444,<br>    &quot;USD&quot;: 1.0<br>  },<br>  &quot;base&quot;: &quot;USD&quot;,<br>  &quot;date&quot;: &quot;2020-10-02&quot;<br>}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd752e92fc64a73f84871da9d3b7a4ab/href">https://medium.com/media/cd752e92fc64a73f84871da9d3b7a4ab/href</a></iframe><p>Now we’ll create <strong>ExchangeRequestManager, </strong>which works as our Network layer. It will accept from and to currency in parameter and return the <strong>ExchangeRate</strong> model in output.</p><p>For that go to <strong>Currency Widget → Service </strong>&amp; create <strong>ExchangeRequestManager.swift </strong>file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d30fad0cf56b82db7f55ee21a8894aa/href">https://medium.com/media/1d30fad0cf56b82db7f55ee21a8894aa/href</a></iframe><p>Our Model and Service are ready 🚀, Now we have to create Timeline entry and TimelineProvider which will hold the entries of data, and advises WidgetKit when to update a widget’s display.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bcf90a0c81bae5f0913a74851470f34/href">https://medium.com/media/3bcf90a0c81bae5f0913a74851470f34/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15e1af2815639aabf4a219462409f39a/href">https://medium.com/media/15e1af2815639aabf4a219462409f39a/href</a></iframe><p>In the above code, I will explain the major 3 points</p><ol><li>We have created one enum which is the same replicate of a custom intent enum. We’ll use this enum for our internal purpose.</li><li>In the second point, we are mapping the custom intent values into our <strong>CurrencyType</strong> enum. Because it’s easy to use an enum instead of <strong>ConfigurationIntent</strong></li><li>We will generate the timeline, by calling the API from <strong>ExchangeRequestManager. </strong>as you can check, first we have converted the configuration values into CurrencyType, then passed as param in function.</li></ol><p>Now everything is on hand, We just have to display the data into view, So now we will create the <strong>View, </strong>which displays the data of the <strong>ExchangeRate </strong>model.</p><p>So we will go to <strong>Currency Widget → View </strong>&amp; create <strong>CurrencyWidgetView.swift </strong>file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/174d89cccdd827a7fb26de303563bcc2/href">https://medium.com/media/174d89cccdd827a7fb26de303563bcc2/href</a></iframe><p>In the above code, we have created a view in <strong>VStack</strong> to display the currency data, and we have created a responsive view to display only when the Widget is kind of the <strong>medium</strong> family.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*r0MGJDcLpEp6EthLLdspOA.png" /></figure><p>Now only one thing is remaining, we have to configure the settings of our Widget, in that we will change the display title and <strong>supportedFamilies. </strong>In this widget, we only going to add support of small and medium family widgets.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/138bc41248d5900f1addb162a85e0e19/href">https://medium.com/media/138bc41248d5900f1addb162a85e0e19/href</a></iframe><p>Now let’s run the output and checks, how it will show in Simulator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*bH0G8NZDCLSLiwCWKL20tA.gif" /></figure><p>That’s it for today, I hope you learn something about WidgetKit from this article.</p><p>If you like this article then please make a clap 👏🏻 for the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19e1075c0093" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/configurable-ios-14-widget-using-widgetkit-19e1075c0093">Configurable iOS 14 Widget using WidgetKit</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Become Full Stack Mobile developer (Vapor + Flutter) — Part 3]]></title>
            <link>https://jaydeepvora.medium.com/become-full-stack-mobile-developer-vapor-flutter-part-3-57102c4c03d4?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/57102c4c03d4</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Sat, 30 May 2020 19:08:26 GMT</pubDate>
            <atom:updated>2020-06-11T08:46:30.392Z</atom:updated>
            <content:encoded><![CDATA[<h3>Become Full Stack Mobile developer (Vapor + Flutter) — Part 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUI97-2sJUtLsXnMnw5LdA.png" /></figure><p>In the previous parts, we have created API using vapor and also created a web page. If you still not reached to the previous part, you can get it from below 🧐</p><ul><li><a href="https://medium.com/@jaydeepvora/become-full-stack-mobile-developer-vapor-flutter-part-1-8ef83fcfb987">Become Full Stack Mobile developer (Vapor + Flutter) — Part 1</a></li><li><a href="https://medium.com/@jaydeepvora/become-full-stack-mobile-developer-vapor-flutter-part-2-c552d3c7eeb1">Become Full Stack Mobile developer (Vapor + Flutter) — Part 2</a></li></ul><h3>Flutter App</h3><p>First of all, create new flutter app with name <strong>covid_19_india, </strong>if you don’t know how to create an app in flutter please visit below link</p><p><a href="https://flutter.dev/docs/get-started/test-drive?tab=terminal">https://flutter.dev/docs/get-started/test-drive?tab=terminal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*caPz9CPMAHuBrnfL.jpeg" /><figcaption>Vapor and Flutter</figcaption></figure><p>Now Let’s go to the code, First, we are going to add required dependencies which we need to run our app.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3ef3b7f53d5363ba5467598a8501be9/href">https://medium.com/media/a3ef3b7f53d5363ba5467598a8501be9/href</a></iframe><p>In the previous section, we have created one route with <strong>“api/covid19”, </strong>which is our path to access the API, so we are gonna use it here. But first, let’s take a look at our initial flutter code which is the initial screen of the flutter app.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b889b1b96530a36eeae1baf40dc67298/href">https://medium.com/media/b889b1b96530a36eeae1baf40dc67298/href</a></iframe><p><strong>MyHomePage</strong> is our first screen, so we will add all the code inside it, Ok so now we will create a model to parse the data and then call API and get the data from our server as like below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8568109c00d34c33645e1c2c6c47c82/href">https://medium.com/media/c8568109c00d34c33645e1c2c6c47c82/href</a></iframe><p>Next, we will add <strong>_getCovidPatientsData()</strong> API function in <strong>_MyHomePageState</strong> class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2608fd31f81e8785f4b97564bc924f58/href">https://medium.com/media/2608fd31f81e8785f4b97564bc924f58/href</a></iframe><p>And it’s time to design the UI of the Covid-19 state-wise list, as we have done in a Web page, So first we create a small part of the UI which is repeating in the list.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad95bed5643808bc9f3087c0a87b2f81/href">https://medium.com/media/ad95bed5643808bc9f3087c0a87b2f81/href</a></iframe><p>Now we create all the small parts of our design, so it’s time to assemble into one layout inside the <strong>build(BuildContext context) </strong>method. Also, we will create collapse and expand feature for each state, so it will display different types of case details.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53ffbe22c4ccd45228f469f87773a7ba/href">https://medium.com/media/53ffbe22c4ccd45228f469f87773a7ba/href</a></iframe><p>Now we can see the output by running the code in a device or simulator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*qOfW2o8n8eiB68l7-czAOQ.gif" /></figure><p>Hurray, Finally we are done with the Flutter app also 🎉</p><p>If you like this article do more and more claps 👏. And If you have any query, please leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57102c4c03d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Become Full Stack Mobile developer (Vapor + Flutter) — Part 2]]></title>
            <link>https://jaydeepvora.medium.com/become-full-stack-mobile-developer-vapor-flutter-part-2-c552d3c7eeb1?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/c552d3c7eeb1</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Fri, 29 May 2020 19:28:55 GMT</pubDate>
            <atom:updated>2020-06-11T08:45:21.333Z</atom:updated>
            <content:encoded><![CDATA[<h3>Become Full Stack Mobile developer (Vapor + Flutter) — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_YTo8HpGu5Ve47w3X0RGg.png" /></figure><p>In the previous part, we had learned how to create API using Vapor (aka Server-side Swift). If you still not reached to the previous part, you can get it from below 🧐</p><p><a href="https://medium.com/@jaydeepvora/become-full-stack-mobile-developer-vapor-flutter-part-1-8ef83fcfb987">Become Full Stack Mobile developer (Vapor + Flutter) — Part 1</a></p><p>Now in this part, we will use API previously created in Web Page and Flutter App</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*ZkqjWCQMXlS82BXj.jpeg" /></figure><h3><strong>Dynamic Web Page</strong></h3><p>First, we are going to create our Web Page, as we have seen we have created a <strong>“covid19” </strong>path to access the web page, and as per request on the <strong>“covid19” </strong>route,<strong> </strong>we have rendered <strong>“healthData”</strong> file.</p><p>So we are going to create <strong>healthData.leaf</strong> file under <strong>/Resource/Views directory, </strong>which contains HTML, CSS, and leaf script code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa05b08b31137a80f73c7eb64d5e1118/href">https://medium.com/media/fa05b08b31137a80f73c7eb64d5e1118/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ZFSAtHpDTBn49--kFMUqtQ.png" /></figure><p>I know it’s too large, we can make it modular, But this just a very basic example so I have taken inline CSS.</p><p>As we already know that we have passed data(context) with render in <strong>view().render </strong>method, so we have used this data with scripting inside HTML tags.</p><ol><li>Code line 44 - 101 represents the &lt;table&gt; element which uses <strong>totalCase </strong>variable of <strong>PageData</strong> context,</li><li>Code line 106 - 163 represents <strong>statesData</strong> which is an array of states, So we have used for loop to iterate and render data inside &lt;table&gt; element.</li></ol><p>Now run the server again and open a browser and enter URL <a href="http://localhost:8080/covid19"><strong>http://localhost:8080/covid19</strong></a><strong>, </strong>it will render our web page as like below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRSuO28rIcLJnEdpPXqVfA.png" /><figcaption>Covid-19 case data in the Web page</figcaption></figure><p>Surprise 🥳</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*FED6kZu1koTorgE_LlexKg.png" /><figcaption>OMG</figcaption></figure><p>So that’s it in this part, we have created the Web page using Leaf and Vapor route, Now in next part, we will create flutter app which represents the same data like in web page above,</p><p>If you like this article then please do multiple claps 👏 , If you have any query please leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c552d3c7eeb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Become Full Stack Mobile developer (Vapor + Flutter) — Part 1]]></title>
            <link>https://jaydeepvora.medium.com/become-full-stack-mobile-developer-vapor-flutter-part-1-8ef83fcfb987?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ef83fcfb987</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Thu, 28 May 2020 17:17:09 GMT</pubDate>
            <atom:updated>2020-06-09T09:53:38.501Z</atom:updated>
            <content:encoded><![CDATA[<h3>Become Full Stack Mobile developer (Vapor + Flutter) — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lDwhDQY01WwMQIccZC42g.png" /><figcaption>How to become a Full-stack Mobile developer?</figcaption></figure><p>Hello Friends 🖐, Here I’m with another article which helps you to become a Full Stack Mobile developer, Most of the mobile developers have a fantasy that they can also develop backend code (like RESTful APIs, Socket, Authentication). But mostly they have a question, “How can I learn Server Environment or Backend?”</p><p>So Don’t Worry I’m are here to remove this hurdle If you know Vapor (Server-side Swift) and Flutter (iOS + Android) then it’s great or you can take the below reference for prerequisites. 🧐</p><ol><li>Vapor (Server-side Swift)</li></ol><p><a href="https://vapor.codes/">Vapor</a></p><p>2. Flutter</p><p><a href="https://flutter.dev/">Flutter - Build apps for any screen</a></p><p>Ok So Let’s start our journey, We will take one example to complete understanding of this process, We’ll create backend API to get the data, and then we’ll create <strong>Covid-19</strong> Application for Web and Flutter.</p><p>Part — 1: Covid-19 Case API (Vapor)</p><p>Part- 2: Web(HTML + Leaf) &amp; Mobile app (Flutter)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*LoIl8t53Q7pndj5ilk3nUA.jpeg" /></figure><p><strong>Note: </strong>we will use <a href="https://api.covid19india.org/"><strong>https://api.covid19india.org/</strong></a> API, Which is open-source for use to create our application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*31ha03kUg1y9jz9_VZIi7Q.png" /><figcaption>Fascinating</figcaption></figure><h3>1. Create API</h3><p>If you want to learn how to create a new project and project structure in Vapor please have a look in below link</p><p><a href="https://docs.vapor.codes/3.0/getting-started/hello-world/#new-project"><strong>https://docs.vapor.codes/3.0/getting-started/hello-world/#new-project</strong></a></p><p>Now you can see multiple files will automatically be created, These files are basic parts of Vapor application. You can see basic directory architecture below:</p><pre>├── Public<br>├── Sources<br>│   ├── App<br>│   │   ├── Controllers<br>│   │   ├── Models<br>│   │   ├── boot.swift<br>│   │   ├── configure.swift<br>│   │   └── routes.swift<br>│   └── Run<br>│       └── main.swift<br>├── Tests<br>│   └── AppTests<br>└── Package.swift</pre><p>Now open Package.swift file, By default you can see the <strong>Vapor </strong>package, But we have to add extra <strong>Leaf</strong> (View Render) and <strong>SwiftyJSON </strong>(JSON data helper) package as below and run <strong>vapor update </strong>command to effect the change.</p><p><a href="https://docs.vapor.codes/3.0/leaf/getting-started/"><strong>Leaf</strong></a> is a powerful templating language with Swift syntax, We will use this package to make our web app.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bada608b146768a454f7eed00878c90d/href">https://medium.com/media/bada608b146768a454f7eed00878c90d/href</a></iframe><p>We have added Package, but yet we have to register the particular package service for use. So we are doing this by using <strong>configure.swift </strong>file.</p><p>Register <strong>LeafProvider </strong>service in <strong>configure.swift</strong> as like below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c197ba363bba22c91a9dac63a06fb39/href">https://medium.com/media/7c197ba363bba22c91a9dac63a06fb39/href</a></iframe><p>Now its time to move to file where we will actually create our API, You can find <strong>routes.swift </strong>file under the <strong>Sources/App</strong> directory.</p><p>routes.swift file contains one global function <strong>routes(_ router: Router)</strong>, which manage all the GET, POST, PUT, etc. request inside it. When you open routes.swift file you can see one default route is already created for example purpose as like below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ff65d193340c34d314045e85f2c5cbd/href">https://medium.com/media/1ff65d193340c34d314045e85f2c5cbd/href</a></iframe><p>Now run the server by pressing (command <strong>⌘ + </strong>R) keys. You will see the log in the console indicating that <strong>Server starting on </strong><a href="http://localhost:8080,"><strong>http://localhost:8080</strong></a>, which means your localhost server is located at 8080 port.</p><p>Now open a browser and type <a href="http://localhost:8080/hello">http://localhost:8080/hello</a> URL, it will show Hello, world! in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*KMQ7kiV0_2hXEsYe3E-_ng.png" /><figcaption>Simple GET request</figcaption></figure><p>Now it’s time to Create our custom API which will provide Covid-19 case data as per State wise.</p><p>But before that, we need one model to represent our API data in a proper format. For that, we will create <strong>HealthResponse.swift </strong>file under <strong>Models</strong> directory</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c3d6b3e6098f44974d264f459c3a78c/href">https://medium.com/media/7c3d6b3e6098f44974d264f459c3a78c/href</a></iframe><p><strong>code</strong> represents response code, <strong>data</strong> represent our API data and <strong>message</strong> is for custom notation</p><p>So now we are adding one more route <strong>/api/covid19 </strong>in routes.swift, Which also a GET request, We will use this api in our Flutter mobile app in the next part of the article.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c7402d131f78f061d07542c875331ce/href">https://medium.com/media/9c7402d131f78f061d07542c875331ce/href</a></iframe><p>To understand the above code, we will breakdown the code in steps</p><ol><li>At first, the router forwards the request to at path <strong>“api/covid19”. req</strong> is our request variable, we will get Covid-19 case data on the same request by using <strong>req.client().</strong></li><li>Now data from third-party api <a href="https://api.covid19india.org/data.json">https://api.covid19india.org/data.json</a> is available, so we will convert data to JSON by using SwiftyJSON. Also, we can use a custom model to parse the nested data</li></ol><p>3. Now pack all the details in <strong>HealthResponse </strong>model and return it</p><p>That’s it. We are done with our API, We can check this API in postman or other REST api tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hD9pkQUKjzw2XXy320W2hw.png" /><figcaption>Check API in Postman</figcaption></figure><p>Hurray we have successfully run our API request 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*7_LyvYu7EjLJkw4IyLKBzw.png" /><figcaption>Look I’m the King</figcaption></figure><p>Now we will create one more route to display the data in the web page, For that, we need a model to pass the data in Leaf Renderer</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98408de727e0322b50da0e54e47782e3/href">https://medium.com/media/98408de727e0322b50da0e54e47782e3/href</a></iframe><p>Next, we add <strong>“covid19” </strong>route to our route, and it returns <strong>View </strong>to display data in a web page, So basically we can access our webpage by <strong>/covid19</strong> path</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/094cf07eb1db798726cfcb4e7cf53f3b/href">https://medium.com/media/094cf07eb1db798726cfcb4e7cf53f3b/href</a></iframe><p>Let’s breakdown the process again.</p><ol><li>When we get the data from third-party API, first we will decode data into our model, here response contains <strong>“statewise”</strong> key with array value, So we will prepare <strong>[StateWiseData]</strong></li><li>The first element contains total India’s Covid-19 patient count, So we will make it separate, So now <strong>stateWiseData </strong>array only contains state data.</li><li>Next, we will create a temporary model <strong>PageData</strong> to prepare the data context for the view render.</li><li>Pass totalCase and stateData into a parameter</li><li>Finally, we can call our Web Page renderer and pass the data into context.</li></ol><p><strong>Note: </strong>Here you will find <strong>“healthData” </strong>(which actually a healthData.leaf file), this one is our webpage file which contains HTML, CSS, and leaf script code, we will design this web page in our next part of an article.</p><p>In the next part, we will Create our Web Page and Flutter app to display this data in a very beautiful format.</p><ul><li><a href="https://medium.com/@jaydeepvora/become-full-stack-mobile-developer-vapor-flutter-part-2-c552d3c7eeb1">Become Full Stack Mobile developer (Vapor + Flutter) — Part 2</a></li><li><a href="https://medium.com/@jaydeepvora/become-full-stack-mobile-developer-vapor-flutter-part-3-57102c4c03d4">Become Full Stack Mobile developer (Vapor + Flutter) — Part 3</a></li></ul><p>If you like this article, then do more and more and more claps 👏. If you have any query please leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ef83fcfb987" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build fast and better Apps with SwiftUI]]></title>
            <link>https://jaydeepvora.medium.com/build-fast-and-better-apps-with-swiftui-dd33ca13e9c7?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd33ca13e9c7</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Wed, 11 Sep 2019 18:34:48 GMT</pubDate>
            <atom:updated>2019-09-17T16:35:31.571Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lo2RsNTZ1iA4ljYJmKPY4Q.png" /></figure><h3><strong>What is SwiftUI?</strong></h3><blockquote>SwiftUI is an innovative, exceptionally simple way to build user interfaces across all Apple platforms with the power of Swift.</blockquote><p>SwiftUI uses Declarative approach to design the UI. Which means your code is simpler and easier to read than ever before, saving you time and maintenance.</p><h3>Why SwiftUI is Better?</h3><p>SwiftUI provides an awesome feature for you like Declarative UI, Easy Localization, Easy to add Dark Mode support, Easy Animation, Accessibility Native on All apple platforms(iOS, iPad, macOS, watchOS, tvOS). So you can more focus on your App-specific feature than basic features.</p><h3>How we can integrate into our App?</h3><p>Without giving more explanation about SwiftUI, we move to implement one Social application so you can get more idea about SwiftUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PWYUflxw2WhPxOlGOWPITg.png" /></figure><p>So the above screens are a target for us, And we have to achieve with SwiftUI. Then let’s start the drive and go for an awesome journey.</p><ol><li>First, open Xcode 11 and create a new project with whatever name you want to assign, Don’t forget to check Use SwiftUI checkbox otherwise it will create normal Xcode project and click on <strong>Next</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*84TD3iG_lRcDzJoPjMvJjA.jpeg" /><figcaption>image (2) — New Project</figcaption></figure><p>You can see the newly created project with some swift files. Now you can see <strong>ContentView.swift</strong> file, just click on and you can see some template code. You can consider this ContentView struct as your application’s entry point.</p><p>Because we pass this ContentView in our <strong>SceneDelegate</strong>’s method as <strong>rootViewController</strong> to <strong>UIWindow</strong> as like we did in AppDelegate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*ERCFm2BbRqivGBa2Tns7Rg.jpeg" /></figure><p>Now we first lookout at our app and determine the functionality, So as per screen we have horizontal Stories and vertical Post as like we have in the Facebook application. therefore we are preparing the Story and Post Model and data for the app.</p><p><strong>Story.swift</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*MmwHaZyMx-l59aq6-201Gw.png" /></figure><p><strong>Post.swift</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*dqy3p2w-RK0TXaN2YONc1w.png" /></figure><p>Now we are going to design our screen, as we did by creating ViewController earlier. But the difference is we are taking Container here. We are putting all our view inside the body, and all our code is wrapped inside the body which is <strong>View</strong> type computed property. Also, we had to take our data source <strong>posts</strong> and <strong>stories</strong> here. We can use it later.</p><p>Below is a simple example with Hello World text, and we can preview this code using <strong>PreviewProvider</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*EuosI-_WA9ScFQu_wSPORw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*-h2vq5qA0pVRCgK3UrWXlw.png" /><figcaption>Output of ContentView</figcaption></figure><p>Now if we want to add NavigationBar we have to wrap the Text inside Navigation Container, In SwiftUI we have <strong>NavigationView</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*_YMsztVxUb6QpHhtockOEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/1*UmCD4Novinj2-grrV7IuJA.png" /><figcaption>Text with NavigationView</figcaption></figure><p>Now we are going to create the StoryView first. For that, we have to find the last element of the Story view. We can consider this view as horizontal UICollectionView and each view inside is cell. So we start designing by like this as we did before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*9F2Ns2jSMF5kGyUq-KGXZQ.png" /><figcaption>StoryView</figcaption></figure><p>So below is the code to design the particular StoryView Cell,</p><ol><li>Story image(1.1) and Story name(1.2) are arranged in Vertical position, So <strong>VStack</strong> (1) is better for this</li><li>Now we have Circle shape(2) and User avatar (3) overlapped on Story image so for that, we are considering <strong>ZStack</strong> element to achieve this.</li></ol><p>Now our one cell design is ready. we can put it inside a <strong>List</strong> as we did in table view or collection view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*-j0QKaYABPMCmELTgh6MWw.png" /><figcaption>StoryView Cell</figcaption></figure><p>You find many functions chaining with controls like Image, Text, Button, etc. We called these function as a <strong>view modifier</strong> because they modify the view appearance.</p><p>Now we can create the Horizontal list for stories, Stories are in the horizontal direction, so we are taking <strong>HStack</strong>, but we also need <strong>ScrollView</strong> to throughout the whole list. Also, we have <strong>Trending</strong> text above story list, and we are arranging text and list into <strong>VStack.</strong></p><p>To iterate through all Stories we use <strong>ForEach</strong> structure, it will compute views on demands for the given collection of identified data. We have to pass content in ForEach, So our StoryListCell will passed here. Now you might understand how we created the Story list using ForEach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*nUXPSc9EOViRkzZOCXRImg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/1*ls3rsq3gRt9MqgyWW9erHQ.png" /><figcaption>Horizontal Story List</figcaption></figure><p>Now we are going to design the Post View for that, We again find the last element in-depth of the view hierarchy. So above postview item is our core view for Post view list. In the view we have user avatar, name, post time, post title, and image of the post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*X4ct9t_mwOZUUW9q9WNamg.png" /><figcaption>PostView item</figcaption></figure><p>We start from an outer arrangement of view because as you see in the layout</p><ol><li>User info(1), Post title(2), and Post image(3) are aligned in Vertical, So we take <strong>VStack</strong> for that.</li><li>Avatar(1.1) and Name(1.2.1), Post time(1.2.2) pair are aligned Horizontally, So <strong>HStack</strong> should be here.</li><li>And again Name(1.2.1) and Post time(1.2.2) are aligned Vertically, So simply <strong>VStack</strong> is required.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*mWo8B6GNWk7jxhXp-Ho5EQ.png" /><figcaption>PostList Cell</figcaption></figure><p>Now we can add this PostView Cell to <strong>List</strong> so we get a list of posts as we did for Story List, but the difference is we are arranging the post in vertical scroll.</p><p>Now we have Story list and Posts in vertical alignment as see in the image(1). So we thought VStack is best for this. But not, We have to make this whole view scrollable, so we have to think for another layout container. And the option is <strong>List </strong>itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*rWwdaahIbYPG_OBqeObZXA.png" /><figcaption>Code — Combine views in List</figcaption></figure><p>Using List, We can combine multiple views inside List to make it scrollable (if it’s content size is exceed than screen). In Above code, we combine VStack (1.1) and Post list(1.2) into List.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*yxXfoAeNT-sD0GuMaXki5Q.png" /><figcaption>Combine views in List</figcaption></figure><p>But slightly we need some separator between stories and posts, therefore we can use section as we did in UITableView, <strong>Section</strong> is used to make view hierarchy more affordance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*6ZsMQ57yyKvs2YUh6VuEyA.png" /><figcaption>List with Section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*YlNhxD6PYSCq13_BrPYBpg.png" /></figure><p>Finally, we achieved our target, but this is not the end yet. we can add more feature into this app, like Localization, RTL support, Dark Mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ttDLdSXjx2oL4x24ughpcg.png" /><figcaption>Finally Achieved</figcaption></figure><p>Localization is a tricky task for every app when we are going to implement the inside application. But SwiftUI just takes a chill and implement easily😎</p><p>Just add new string file named <strong>Localizable.strings</strong>, and localize file with multiple languages, here we take 2 language, so we add the hardcoded string used while development in these string file with values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*O2vS5Uyw-H7TMmGbt9TeNw.png" /><figcaption>Localizable.strings (English)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*rnBGlwoSZuhXR3t_Qhw1fQ.png" /><figcaption>Localizable.strings (Arabic)</figcaption></figure><p>It’s Done, Yeah you can clap for that, Amazing Right!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*LUCHxol5las9lselQH9b9g.jpeg" /><figcaption>So Easy</figcaption></figure><p>Now let’s check the different preview of Localizations, for that we have to set the environment variable as like <strong>locale</strong>, <strong>layoutDirection. </strong>And also if we want to more than one preview, we have to group them using <strong>Group</strong> structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*D1z0EDKhGoY12qZmyWlbQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*HW5SX5Xos5lC8HzM15-OHg.png" /><figcaption>Arabic Localization with RTL support</figcaption></figure><p>Now, what if want adds Dark mode accessibility in the app, it’s a very tricky task in previous methods, But with SwiftUI we have <strong>Semantic Color </strong>support, so it’s now easy for to implement Dark Mode in the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*sxJaE2oYU9RRR_wwS0qbTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*8-ZFPAD_ezTnkyj8Qq263g.png" /><figcaption>Dark Mode Support</figcaption></figure><h3>Summary</h3><p>So far, we had implemented the Declarative UI using SwiftUI, Different SwiftUI components, Localization, Dark mode. And also we learned how we can adopt SwiftUI into our development process.</p><p>Hope you like the article, and find useful information form this, If you have any query you can leave a comment or do some clap below :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd33ca13e9c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sign in with Apple in the iOS App]]></title>
            <link>https://jaydeepvora.medium.com/sign-in-with-apple-in-the-ios-app-a8034435f73f?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8034435f73f</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-13]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[sign-in-with-apple]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Sun, 04 Aug 2019 16:59:29 GMT</pubDate>
            <atom:updated>2019-08-04T16:59:29.194Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*Rf_TcuV17jf3Oz1-j6nLAA.jpeg" /></figure><h3>Introduction</h3><p>Till now we had heard about the login with Facebook and Gmail and another platform, But now Apple also dives into this feature, With iOS 13 they decide to start providing an easy, fast and safe way to login with your apple account in-app.</p><p>It works on iOS, macOS, tvOS, and watchOS. We can also add Sign in with Apple to Website and other mobile platforms.</p><p>If we look at the security perspective, Sign in with Apple provides a better option for user and developer then other Third-party login platforms where they failed security and privacy breaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*gkDFY9-LFSbwO_RiwTxO8w.jpeg" /><figcaption>I’m excited to know</figcaption></figure><h3>Integrate “Sign in with Apple” in the iOS App</h3><p>Yes, I know that you are excited to see this feature in your iOS app, Ok then we are gonna implement in our app.</p><h4>1) Setup Sign in with Apple in project</h4><p>Now, open Xcode 11 and then create the project, Hope it&#39;s easy for you that why I’m not going deep in this.</p><ul><li>Now add <strong>Sign in with Apple </strong>capability in your App, to do this Go to “Target” and click on “Capability”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dif0gBUX_IHr4HalF4AAwg.jpeg" /><figcaption>Add Sign in with Apple in Capability</figcaption></figure><ul><li>Now enable this Sign in with Apple capability in app identifier in AppStore Connect. <strong>Certificates, Identifiers &amp; Profiles Identifiers</strong> → <strong>Identifiers </strong>→ You app identifier</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zf1z7GWJdPYdoaWODiJZ9w.jpeg" /><figcaption>Add Sign in with Apple in application identifier</figcaption></figure><ul><li>Also, add Keys for Apple Sign in, For that Go to <strong>Certificates, Identifiers &amp; Profiles Identifiers</strong> → <strong>Keys</strong>→ Create Key</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pz5Y1OcMGc9LpxFkotvPQQ.jpeg" /><figcaption>Create keys for Sign in with Apple</figcaption></figure><ul><li>Enter the name of keys and don’t forget to check Sign in with Apple option. after that click on the configure button in the same line and choose our app bundle id.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfDkV1Rd2VGJgladfjvd0g.jpeg" /><figcaption>Register for Sign in with apple and configure the key</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6iOCId7Getl3qLrpYqw_Yg.jpeg" /><figcaption>Choose app bundle id</figcaption></figure><p>Now after selecting the bundle id, <strong>Save</strong> the process and <strong>Register</strong> the Key.</p><h4>2) Let’s do the Code</h4><ul><li>Open ViewController and add below code</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJctDVPCnMgNYoIen0OQ4g.jpeg" /><figcaption>Setup the Sign-in button and Add event on the button.</figcaption></figure><p>Above code contains a method <strong>setupAppleSignIn</strong>, It will setup Apple Sign in button in View of ViewController. I had also added target for the <strong>ASAuthorizationAppleIDButton</strong> Control called <strong>appleSigninTapped().</strong></p><p>In <strong>appleSigninTapped </strong>event <strong>ASAuthorizationAppleIDProvider </strong>class generates the request to authenticate the user based on their Apple ID. <strong>ASAuthorizationAppleIDRequest </strong>create the request and defined contact information scope using .fullName and .email.</p><p>Now we created the request object so we have to just pass the object to <strong>ASAuthorizationController</strong>, And set presenter and delegate to <strong>self</strong> (current ViewController). Now we are finally ready to show the UI for Apple sign in for that just call <strong>performRequests() </strong>method of <strong>ASAuthorizationController.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*SmuiWfGZfJ6ToSWOZShVtg.png" /><figcaption>Still getting Error.</figcaption></figure><p>Wait Wait, I know you are still got Error, we are just one step ahead, Remeber we had assigned the delegate and presenter to self, So we have to implement the <strong>ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding </strong>methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*xH8vDG4pHBXGf_ZrjQAo3g.jpeg" /></figure><p>Now in the above code, <strong>ASAuthorizationControllerDelegate </strong>has<strong> </strong>2 methods to decide whether an authorization is completed or failed.</p><p>To present the Authorization controller you can use <strong>presentationAnchor(for controller: ASAuthorizationController) </strong>method. In which you have to provide the anchor window.</p><p>And now the code is error-free, We can run the app and check the feature. it will show Sign in with apple button in the center of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8ENH-kE0efgTcpJkPRzpg.jpeg" /></figure><p>When you tap on the button it will open the popup with Apple ID information. you can continue to login.</p><p>To add the Sign in with Apple button in your design you must have to consider <a href="https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/">Human Interface Guidelines: Sign In with Apple</a>.</p><p>And for privacy concern <a href="https://developer.apple.com/app-store/review/guidelines/#data-collection-and-storage">App Store Review Guidelines: Privacy</a> you can visit this link.</p><p>Done, That’s it</p><p>Hope you found helpful information from this article If you love this article make some clap. or if you have any query write in comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8034435f73f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SkeletonView animation in UITableView]]></title>
            <link>https://jaydeepvora.medium.com/skeletonview-animation-ade973655d03?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/ade973655d03</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 08:34:17 GMT</pubDate>
            <atom:updated>2020-05-20T14:12:24.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zibJRggaHpaB6vRf0Uzv1g.png" /></figure><p>Hello Developers, we are coming with a new story</p><p>As we had seen many times some of the great websites and mobile apps using gradient animation until fetching data from the server and populate on the list.</p><p>We can also implement this type of animation in UICollectionView or UITableView controls to make it look like awesome ever.</p><h4>Why we are putting this animation?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*U1nQGr6v95yBt2YRlsLhqQ.jpeg" /></figure><p>The benefit behind this type of animation is we don’t have to block the user interface while fetching the data from the server by putting a loader or something. like we know too much loader and UI block irritates the user. But this type of animation keep users fill live with apps :)</p><h4>How can I Integrate into my code?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*CbHAb2kM8Tg5GwbWAUdeLA.jpeg" /><figcaption>Can we start?</figcaption></figure><p>Easy Easy, Now we are going to integrate into our list, First of all, visit this awesome <a href="https://github.com/Juanpe/SkeletonView"><strong>Skeleton</strong></a> Library and integrate into your Xcode project using Pod or Carthage. or you can simply put it.</p><p><strong>Pod:</strong></p><pre>pod &quot;SkeletonView&quot;</pre><p><strong>Carthage:</strong></p><pre>github &quot;Juanpe/SkeletonView&quot;</pre><p>After installing the dependency, You can find <strong>isSkeletonable</strong> attribute in your Storyboard/Xib Attribute inspector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*JtqCEV-3dNG7J3iZemJg-w.png" /></figure><p>If you want to show animation in your control like (UILabel, UIButton, UIView, etc…) just set it to On.</p><h4>Setup in UITableViewCell :</h4><p>I hope you understand till now and set <strong>isSkeletonable </strong>to On mode. Now follow the below procedure to display animation in UITableView.</p><p>In your UITablViewCell class put below code in <strong>awakeFromNib() </strong>to start the animation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*0BgUOOUWMVsoJeydqJ6vWg.png" /><figcaption>Start animation in controls</figcaption></figure><p>But if you have too many controls in Cell you can use the below shortcut to apply the animation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*n3mWC7elY7vh_CGVgxcSDg.png" /><figcaption>Short way to group operation.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/146/1*1fYHRXpFpi0wtC6vcjvPFw.jpeg" /><figcaption>Ohh I Love this dude.</figcaption></figure><p>And also add a method to hide Skeleton when data is available after a Server request. put below method in UITableViewCell class <strong>awakeFromNib().</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*2vV9_DWg3QytqY7LY-lF6w.png" /><figcaption>Hide animation on control</figcaption></figure><p>Now we move to controller and populate data in UITableView. We have one User model for data. which contains a name, mention name, description, and image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*niF-epe_zFvev1WLPhUpQg.png" /><figcaption>User model</figcaption></figure><p>Create an array of <strong>Users </strong>in ViewController which is used as Datasource of TableView.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*bKccHTRxIWSMrQ66VFnc6g.png" /><figcaption>The data source for UITableView</figcaption></figure><p>Here we are implementing <strong>UITableViewDataSource</strong> methods, to display animation and data in cells.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*BbTJ_J3XJzp7tvHqj-UOrg.png" /></figure><p>In the <strong>numberOfRowsInSection</strong> method there are line <strong>return users?.count ?? 10 </strong>this indicates that if users array is null (it means till now users data is not available) then it displays default animation cell otherwise it returns array count.</p><p>In the <strong>cellForRowAt</strong> method first, we check if users array is nil then we simply continue with animation otherwise if users array is not nil then we first hide the animation then populate the data.</p><p>Below is the one example which I used in my current project, You can see this beautiful animation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*mu077bdNP9uf7PiQmrprCA.gif" /></figure><p>Keep in mind that this is just a basic Core animation library. In order to achieve great UX, you’ll explore the library and do your own custom animation.</p><p>Leave any comment or do more &amp; more &amp; more clapping :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ade973655d03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxSwift — Pass data using Publish Subject]]></title>
            <link>https://jaydeepvora.medium.com/pass-data-using-publish-subject-rxswift-386dae1b807e?source=rss-d4c141ee7a26------2</link>
            <guid isPermaLink="false">https://medium.com/p/386dae1b807e</guid>
            <category><![CDATA[rxswift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Jaydeep Vora]]></dc:creator>
            <pubDate>Fri, 15 Jun 2018 05:07:58 GMT</pubDate>
            <atom:updated>2020-02-19T13:00:29.103Z</atom:updated>
            <content:encoded><![CDATA[<p>There many peoples describing the different definitions of <a href="http://reactivex.io/intro.html">Reactive programming</a>. but as per my research and analysis, I had found a short line for this.</p><p><strong>“RxSwift is a new paradigm for asynchronous programming.,</strong></p><p>I had been working with RxSwift for the last year, So I had an idea about its benefits. I was able to answer those questions vaguely. I failed to be concise though.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*K1hnHR3KvIxooKCSSoipow.png" /></figure><h3>Notify parent controller about data changes:</h3><p>The first thing is creating an Outlet of UILabel in <strong>ViewController.swift</strong> file with default text and DisposeBag variable. <a href="https://github.com/ReactiveX/RxSwift/blob/master/RxSwift/Disposables/DisposeBag.swift">DisposeBag</a> is a memory management mechanism of RxSwift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*AaT1zqqrsOkvhY1yA13cBQ.png" /><figcaption>Declare variable</figcaption></figure><p>Now, We write code for subscribing which observes the value of EditViewController text and color’s PublishSubject. <strong>PublishSubject</strong> is one of the types of Subjects. We can say that PublishSubject is both Observer and input.</p><p>But as per different subject properties, PublishSubject ignores all elements that were emitted before subscribing.</p><p>We have one Button in ViewController called Let’s Edit which redirects t EditViewController to choose text and color. Below is the code for the button.</p><h4>Subscribe the observer:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*KEnKy1XjJ2PP4mQ3cEAHbw.png" /></figure><p>In the above code, we observe the text and color subject emitted by EditViewController when clicking on the red, green or blue button. this can be done using <strong>subscribe(onNext, onError, onCompleted) </strong>method. subscribe method will be canceled by <strong>disposed(by:) </strong>method.</p><p><strong>onNext() </strong>will emit the value in the below code and that value will be subscribed by ViewController simply.</p><h4>Declaring Publish subject:</h4><p>Here we create the one text field outlet. Also, declare text and color Observer.<br>text observer is a type of String that passes the value of text field and color observer pass the color object as per clicked on color buttons (red, blue &amp; green).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*ZMgD4DiwY5_XDr5MqAOnsg.png" /></figure><h4>Emit element through observer:</h4><p>When the user enters some text on the text field and touches on one of the color buttons below process is happened</p><ol><li><strong>textObserver</strong> emit the text value.</li><li>As per the color button tag, it will pass the color value using colorObserver</li><li>And at last step, it’ll pop to ViewController, so changes can appear.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*J43ubtkJoPbQS-zHW5Lyfg.png" /></figure><p>the demo program output is below. you can check how it is simple &amp; you can also try with your code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*cQD0IshT_nOOw4Xr5DfzVQ.gif" /></figure><p>Enjoy code…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=386dae1b807e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>