<?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 Parth Adroja on Medium]]></title>
        <description><![CDATA[Stories by Parth Adroja on Medium]]></description>
        <link>https://medium.com/@parthadroja247?source=rss-67d02e8fc4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ty2bgcyVNKtAcIyrp1GUhg.jpeg</url>
            <title>Stories by Parth Adroja on Medium</title>
            <link>https://medium.com/@parthadroja247?source=rss-67d02e8fc4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:57:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@parthadroja247/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[Simple progress ring view in iOS]]></title>
            <link>https://medium.com/@parthadroja247/simple-progress-ring-view-in-ios-166896fecf6b?source=rss-67d02e8fc4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/166896fecf6b</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[coregraphics]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[swift-programming]]></category>
            <dc:creator><![CDATA[Parth Adroja]]></dc:creator>
            <pubDate>Sat, 14 Dec 2019 14:05:08 GMT</pubDate>
            <atom:updated>2020-03-15T08:50:14.374Z</atom:updated>
            <content:encoded><![CDATA[<h4>The birth of <strong>UICircularProgressView</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Czr7l1D5YZ9wddDaInW2xg.gif" /><figcaption>UICircularProgressView in work</figcaption></figure><p>I had a requirement in the project to show a progress view having a circular ring UI works in sync with timer.</p><p>Surfed around a couple of pods, blogs. I saw some good pods, blogs but some of them were old other some of them were giving more features which make bigger code, multiple files, and blah blah blah…</p><p>I was not satisfied with the code around the globe and that kicked me to write my own code. This gives the birth to <strong>UICircularProgressView</strong>.</p><blockquote>UICircularProgressView? Yes you heard it right. The basic idea behind this name was to keep it simple and align to the UIKit ecosystem.</blockquote><p><strong><em>What’s it made of? — </em></strong>It’s a subclass of <strong>UIView</strong>, consists of two <strong>CAShapeLayer</strong>. Sound’s simple right? Yes, it’s simple to find it yourself below.</p><h3><strong>Code:</strong></h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/692ef0249fdbb03d62b87d1a040a0d0a/href">https://medium.com/media/692ef0249fdbb03d62b87d1a040a0d0a/href</a></iframe><h4><strong>What can you customise?</strong></h4><p>You got it all rights to customise code and add whatever cool features you would like. Below are the options you would like to customise.</p><ul><li>All UIView properties</li><li>backgroundCircleColor (default is black)</li><li>fillColor (default is white)</li><li>lineWidht (default is 4)</li><li>defaultProgress (default is 0, set value from 0 to 100)</li></ul><h4>Implementation &amp; Function you probably going to use:</h4><ul><li>Add the UICircularProgressView.swift file to your code</li><li>Add a <strong>UIView</strong> in xib or storyboard and change its subclass to <strong>UICircularProgressView</strong></li><li>Or create a <strong>UICircularProgressView(frame: yourFrame) </strong>programatically</li></ul><blockquote>func updateProgress(progress: CGFloat)</blockquote><p>Provide any value from 0 to 100 depending on whatever your use might be for a timer, downloading file, blah blah blah… The progress view will update automatically.</p><h3>The most boring part of how it’s made:</h3><p>The boring part is always interesting.</p><p>It contains two <strong>CAShapeLayer </strong>for a ring. One is the background ring which will be static and won’t change based on the progress value. The other one is the actual progress ring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*oVu5JL4YmzwiQrVaPO_DcQ.jpeg" /><figcaption><strong>CAShapeLayers with its path</strong></figcaption></figure><blockquote>private var progressCircle: CAShapeLayer!</blockquote><p>To draw the ring <strong>UIBezierPath </strong>came to rescue.</p><blockquote>UIBezierPath(arcCenter: centerPoint, radius: circleRadius, startAngle: CGFloat(-0.5 * .pi), endAngle: CGFloat(1.5 * .pi), clockwise: true)</blockquote><p>We found out a center point, the radius is very easy. The actual thing you might need to check is the start and the end angle. The default start angle and end angle is different and is at 3&#39;o clock. We need it at 12&#39;o clock. So we made the start angle to -90 degrees and end angle to 270 degrees so that it starts and ends at 12&#39;o clock.</p><p>The property of <strong>CAShapeLayer </strong>strokeEnd is the key here. We change its value between 0 to 1 based on the progress which serves to fill the progress view.</p><p>And that’s it.</p><h3>Install &amp; Demo</h3><p>Available to add as dependency using Swift Package Manager.</p><p>Check out the demo project on <a href="https://github.com/parthadroja247/UICircularProgressViewDemo"><strong>Github</strong></a><strong>.</strong></p><p>Thanks for reading! Simple isn’t it?</p><p>I would love to hear comments from you peeps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=166896fecf6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LocalAuthentication — Implement FaceID or TouchID in iOS.]]></title>
            <link>https://medium.com/@parthadroja247/localauthentication-implement-faceid-or-touchid-in-ios-a9fd4721d333?source=rss-67d02e8fc4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9fd4721d333</guid>
            <category><![CDATA[local-authentication]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[biometrics]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Parth Adroja]]></dc:creator>
            <pubDate>Sat, 07 Sep 2019 14:29:22 GMT</pubDate>
            <atom:updated>2019-09-07T15:34:19.959Z</atom:updated>
            <content:encoded><![CDATA[<h3>TouchID or FaceID in iOS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*3a7z2n5hbXy0VXd7DptNtw.png" /></figure><h3><strong>How Does it work?</strong></h3><p>Apple provides <a href="https://developer.apple.com/documentation/localauthentication">LocalAuthentication</a> framework to make the life easy for devs.</p><h3><strong>Let’s begin with writing service.</strong></h3><p><strong>FaceID requires user’s permission to be added in Info.plist.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C69PyTZ9D9FNvOzzMhHOZg.png" /><figcaption>Add property, Select <strong>“Privacy — Face ID Usage Description” </strong>from drop down and add a message.</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ecf4caf46f279a43a2651f8f66b21b0/href">https://medium.com/media/8ecf4caf46f279a43a2651f8f66b21b0/href</a></iframe><h3><strong>How to Use it?</strong></h3><p>It’s pretty simple to use it.</p><p>Call the below function by providing the authentication type:</p><blockquote>func authenticate(with type: AuthenticationType, completionHandler: @escaping (Result&lt;Bool, AuthenticationError&gt;) -&gt; Void)</blockquote><p><strong>AuthenticationType</strong>:</p><ol><li><strong>biometrics</strong>: Use this type if you want to authenticate using FaceID or TouchID only. If that fails then you get one more try and then you can use own Fallback method. fallback error will be returned in completionHandler.</li><li><strong>other</strong>: Use this type if you want to authenticate using any available methods. First priority will be provided to FaceID or TouchID by system. If that fails then fallback you will be provided to enter the device Passcode.</li></ol><p><strong>Result&lt;Bool, AuthenticationError&gt;:</strong></p><p>Result type is new type made available in Swift 5. It’s great and easy to use.</p><p>You will get result in completionHandler. Result will either result success or failure.</p><p><strong>case .success: </strong>Authentication Successful.</p><p><strong>case .failure(let error): </strong>There is something wrong with authentication. You get a call back of type error and a generic message for what happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*17_-7sBZBqtf9OooEHjHZQ.png" /><figcaption><strong>So your call would look something like this</strong></figcaption></figure><h3><strong>You are now all set.</strong></h3><p>Feel free to customise the error messages or the code as per your needs. And let me know your thoughts or improvements in the comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9fd4721d333" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>