<?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 Amitesh Mani Tiwari on Medium]]></title>
        <description><![CDATA[Stories by Amitesh Mani Tiwari on Medium]]></description>
        <link>https://medium.com/@appdevbyamitesh?source=rss-b2b03db21a35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*u5OW37BlxKqzuPh1f9HLig.jpeg</url>
            <title>Stories by Amitesh Mani Tiwari on Medium</title>
            <link>https://medium.com/@appdevbyamitesh?source=rss-b2b03db21a35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:26:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@appdevbyamitesh/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[ From Madhubani to Moscow: A Village Boy’s Dream on the Global Tech Stage ]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://appdevbyamitesh.medium.com/from-madhubani-to-moscow-a-village-boys-dream-on-the-global-tech-stage-ba11842839cf?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1282/1*keEDgjRhJG2qvruNu0G95g.jpeg" width="1282"></a></p><p class="medium-feed-snippet">&#x201C;Put your heart into your duty without worrying about the results. The fruit of your action is not your concern.&#x201D;&#x200A;&#x2014;&#x200A;Bhagavad Gita 2.47</p><p class="medium-feed-link"><a href="https://appdevbyamitesh.medium.com/from-madhubani-to-moscow-a-village-boys-dream-on-the-global-tech-stage-ba11842839cf?source=rss-b2b03db21a35------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://appdevbyamitesh.medium.com/from-madhubani-to-moscow-a-village-boys-dream-on-the-global-tech-stage-ba11842839cf?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba11842839cf</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[russia]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 16:22:19 GMT</pubDate>
            <atom:updated>2025-06-12T16:35:57.537Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[ Mastering Swift Inheritance, Initialization & Deinitialization: Essential Concepts for Advanced…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://appdevbyamitesh.medium.com/mastering-swift-inheritance-initialization-deinitialization-essential-concepts-for-advanced-892107225de8?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1400/1*eDc36TuWcpddAukHxVtm5w.jpeg" width="1400"></a></p><p class="medium-feed-snippet">Great code isn&#x2019;t written by chance. It&#x2019;s built on a foundation of strong concepts. Start here, and elevate your Swift expertise!</p><p class="medium-feed-link"><a href="https://appdevbyamitesh.medium.com/mastering-swift-inheritance-initialization-deinitialization-essential-concepts-for-advanced-892107225de8?source=rss-b2b03db21a35------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://appdevbyamitesh.medium.com/mastering-swift-inheritance-initialization-deinitialization-essential-concepts-for-advanced-892107225de8?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/892107225de8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 21:40:35 GMT</pubDate>
            <atom:updated>2024-09-13T21:40:35.841Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[ Mastering Methods & Properties in Swift: Your Ultimate Guide to Cleaner Code!]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://appdevbyamitesh.medium.com/mastering-methods-properties-in-swift-your-ultimate-guide-to-cleaner-code-ec2af96fe484?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1400/1*eDc36TuWcpddAukHxVtm5w.jpeg" width="1400"></a></p><p class="medium-feed-snippet">The best code is the code you never have to write.&#x200A;&#x2014;&#x200A;Jeff Atwood</p><p class="medium-feed-link"><a href="https://appdevbyamitesh.medium.com/mastering-methods-properties-in-swift-your-ultimate-guide-to-cleaner-code-ec2af96fe484?source=rss-b2b03db21a35------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://appdevbyamitesh.medium.com/mastering-methods-properties-in-swift-your-ultimate-guide-to-cleaner-code-ec2af96fe484?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec2af96fe484</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 18:35:16 GMT</pubDate>
            <atom:updated>2024-08-31T15:09:43.949Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[ Mastering Swift Structs and Classes: Your Ultimate Guide to Efficient Code Design ️]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://appdevbyamitesh.medium.com/mastering-swift-structs-and-classes-your-ultimate-guide-to-efficient-code-design-%EF%B8%8F-78d0db58aa8a?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1400/1*eDc36TuWcpddAukHxVtm5w.jpeg" width="1400"></a></p><p class="medium-feed-snippet">Think of classes in Swift as the blueprint of your project, defining the structure while allowing flexibility for future enhancements</p><p class="medium-feed-link"><a href="https://appdevbyamitesh.medium.com/mastering-swift-structs-and-classes-your-ultimate-guide-to-efficient-code-design-%EF%B8%8F-78d0db58aa8a?source=rss-b2b03db21a35------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://appdevbyamitesh.medium.com/mastering-swift-structs-and-classes-your-ultimate-guide-to-efficient-code-design-%EF%B8%8F-78d0db58aa8a?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/78d0db58aa8a</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Fri, 23 Aug 2024 18:59:54 GMT</pubDate>
            <atom:updated>2024-08-23T18:59:54.953Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Mastering Enums in Swift: A Comprehensive Guide to Enumeration Types and Best Practices]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://appdevbyamitesh.medium.com/mastering-enums-in-swift-a-comprehensive-guide-to-enumeration-types-and-best-practices-372a5db33736?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1400/1*eDc36TuWcpddAukHxVtm5w.jpeg" width="1400"></a></p><p class="medium-feed-snippet">&#x201C;Enums are the unsung heroes of Swift, silently organizing your code into a masterpiece.&#x201D;
&#x2013; Swift Developer&#x2019;s Wisdom</p><p class="medium-feed-link"><a href="https://appdevbyamitesh.medium.com/mastering-enums-in-swift-a-comprehensive-guide-to-enumeration-types-and-best-practices-372a5db33736?source=rss-b2b03db21a35------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://appdevbyamitesh.medium.com/mastering-enums-in-swift-a-comprehensive-guide-to-enumeration-types-and-best-practices-372a5db33736?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/372a5db33736</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 18:31:08 GMT</pubDate>
            <atom:updated>2024-08-16T18:31:08.674Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Crush Your iOS Interview:  Insider Secrets to Stand Out and Succeed ]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/swiftbengaluru/crush-your-ios-interview-insider-secrets-to-stand-out-and-succeed-dbabd9809375?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1024/1*EsZqKcL2Lp053PH8PJ4kNw.jpeg" width="1024"></a></p><p class="medium-feed-snippet">&#x201C;The only way to do great work is to love what you do.&#x201D;&#x200A;&#x2014;&#x200A;Steve Jobs</p><p class="medium-feed-link"><a href="https://medium.com/swiftbengaluru/crush-your-ios-interview-insider-secrets-to-stand-out-and-succeed-dbabd9809375?source=rss-b2b03db21a35------2">Continue reading on SwiftBengaluru »</a></p></div>]]></description>
            <link>https://medium.com/swiftbengaluru/crush-your-ios-interview-insider-secrets-to-stand-out-and-succeed-dbabd9809375?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbabd9809375</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Sun, 11 Aug 2024 17:22:03 GMT</pubDate>
            <atom:updated>2024-08-16T18:38:33.286Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Mastering Functions and Closures in Swift: A Comprehensive Guide for Efficient Code]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://appdevbyamitesh.medium.com/mastering-functions-and-closures-in-swift-a-comprehensive-guide-for-efficient-code-302865879d9f?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1600/1*ok3x8HYWLGTvWknKMm71xQ.jpeg" width="1600"></a></p><p class="medium-feed-snippet">&#x201C;Code is like a recipe&#x200A;&#x2014;&#x200A;it only turns out right if you follow the steps precisely.&#x201D;</p><p class="medium-feed-link"><a href="https://appdevbyamitesh.medium.com/mastering-functions-and-closures-in-swift-a-comprehensive-guide-for-efficient-code-302865879d9f?source=rss-b2b03db21a35------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://appdevbyamitesh.medium.com/mastering-functions-and-closures-in-swift-a-comprehensive-guide-for-efficient-code-302865879d9f?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/302865879d9f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Fri, 09 Aug 2024 18:56:50 GMT</pubDate>
            <atom:updated>2024-08-16T18:37:13.365Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Ultimate Guide to Swift Control Flow: Mastering If Statements, Loops, and Early Exits]]></title>
            <link>https://appdevbyamitesh.medium.com/ultimate-guide-to-swift-control-flow-mastering-if-statements-loops-and-early-exits-27f034c40049?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/27f034c40049</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Sat, 03 Aug 2024 20:17:16 GMT</pubDate>
            <atom:updated>2024-08-09T19:18:29.329Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Coding is like riding a bike: control the flow, and you’ll never fall.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ok3x8HYWLGTvWknKMm71xQ.jpeg" /><figcaption><a href="https://www.instagram.com/appdevbyamitesh/">AppDevByAmitesh</a></figcaption></figure><p>Hey there, tech enthusiasts! 👋 I’m Amitesh Mani Tiwari, a Software Engineer (iOS Team) at Angel One📈 with 2.5 years of experience. Over the years, I’ve delivered 35+ tech and non-tech talks 🎤, mentored at hackathons 👨‍💻, and impacted over 9000 students. Oh, and I was also honored as a 21U21 Award Winner! 💖</p><p>Before we dive into the Swift control flow, make sure to check out my previous blogs:</p><ol><li><a href="https://medium.com/@appdevbyamitesh/swift-collections-unleashed-comprehensive-insights-into-arrays-sets-and-dictionaries-8b10474f8c00">Swift Collections Unleashed: Comprehensive Insights into Arrays, Sets, and Dictionaries</a></li><li><a href="https://medium.com/@appdevbyamitesh/mastering-swift-basics-a-guide-to-variables-constants-and-data-types-f61c9d285793">Mastering Swift Basics: A Guide to Variables, Constants, and Data Types</a></li></ol><p>These will give you a solid foundation to build upon as we explore control flow in Swift.</p><h3>Ami’s Swift Journey with Siri: Control Flow Edition 🛤️</h3><p><strong>Ami:</strong> Hey Siri, I’ve mastered Swift collections. What’s the next step in my Swift journey?</p><p><strong>Siri:</strong> Ami, it’s time to master control flow! Let’s dive into if statements, loops, and early exits to make your code more efficient and dynamic.</p><p><strong>Ami:</strong> Sounds like a plan! Control flow is like the GPS of coding, right?</p><p><strong>Siri:</strong> Exactly! Without control flow, you’d be coding blindfolded. Let’s get started!</p><h3>Understanding Control Flow in Swift</h3><p>Control flow in Swift allows you to direct the execution of your code based on certain conditions and repeatedly execute blocks of code. This is essential for making decisions, iterating over data, and managing the flow of your application efficiently.</p><h3>For-In Loops</h3><p><strong>For-in loops</strong> allow you to iterate over a sequence, such as arrays, dictionaries, ranges, or strings.</p><p>Imagine you’re a chef preparing a list of dishes for a dinner party. You have an array of dishes, and you need to print each one to ensure everything is accounted for:</p><pre>let dishes = [&quot;Salad&quot;, &quot;Soup&quot;, &quot;Pasta&quot;, &quot;Dessert&quot;]<br>for dish in dishes {<br>    print(&quot;Preparing \(dish)!&quot;)<br>}<br>// Output:<br>// Preparing Salad!<br>// Preparing Soup!<br>// Preparing Pasta!<br>// Preparing Dessert!</pre><p>You can also iterate over a dictionary to access its key-value pairs. Think of it like checking the ingredients in your pantry, where each item has a name and a quantity:</p><pre>let pantry = [&quot;Flour&quot;: &quot;2 kg&quot;, &quot;Sugar&quot;: &quot;1 kg&quot;, &quot;Eggs&quot;: &quot;12 pieces&quot;]<br>for (ingredient, quantity) in pantry {<br>    print(&quot;We have \(quantity) of \(ingredient)&quot;)<br>}<br>// Output:<br>// We have 2 kg of Flour<br>// We have 1 kg of Sugar<br>// We have 12 pieces of Eggs</pre><h3>While Loops</h3><p><strong>While loops</strong> execute a set of statements as long as a condition is true.</p><p>Imagine you’re jogging and want to count your steps until you reach your daily goal. You keep jogging until you’ve taken enough steps:</p><p><strong>While Loop</strong></p><pre>var steps = 0<br>let goal = 10000<br>while steps &lt; goal {<br>    print(&quot;Keep going, you&#39;ve taken \(steps) steps!&quot;)<br>    steps += 1000<br>}<br>// Output:<br>// Keep going, you&#39;ve taken 0 steps!<br>// Keep going, you&#39;ve taken 1000 steps!<br>// ...<br>// Keep going, you&#39;ve taken 9000 steps!</pre><p><strong>Repeat-While Loop</strong></p><p>The repeat-while loop evaluates its condition after executing the loop’s code block.</p><pre>var reps = 1<br>repeat {<br>    print(&quot;Completed \(reps) repetitions&quot;)<br>    reps += 1<br>} while reps &lt;= 5<br>// Output:<br>// Completed 1 repetitions<br>// Completed 2 repetitions<br>// ...<br>// Completed 5 repetitions</pre><h3>Conditional Statements</h3><p><strong>If statements</strong> execute code based on a condition.</p><p>Imagine you’re deciding what to wear based on the temperature:</p><pre>let temperature = 30<br>if temperature &gt; 25 {<br>    print(&quot;It&#39;s a hot day! Wear light clothes.&quot;)<br>} else {<br>    print(&quot;It&#39;s a cool day! Wear something warm.&quot;)<br>}<br>// Output:<br>// It&#39;s a hot day! Wear light clothes.</pre><p><strong>Switch statements</strong> compare a value against multiple patterns.</p><p>Imagine you’re planning a trip and need to check the day of the week to decide your activities:</p><pre>let day = &quot;Saturday&quot;<br>switch day {<br>case &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;:<br>    print(&quot;It&#39;s a weekday. Time to work!&quot;)<br>case &quot;Saturday&quot;, &quot;Sunday&quot;:<br>    print(&quot;It&#39;s the weekend! Time to relax.&quot;)<br>default:<br>    print(&quot;What day is it?&quot;)<br>}<br>// Output:<br>// It&#39;s the weekend! Time to relax.</pre><p>Control transfer statements change the order of code execution. Swift includes continue, break, fallthrough, return, and throw.</p><p><strong>Continue</strong></p><p>The continue statement tells a loop to stop what it’s doing and start again at the beginning of the next iteration.</p><p>Imagine you’re reading a list of books but want to skip over any book that’s already read:</p><pre>let books = [&quot;Book A&quot;, &quot;Book B&quot;, &quot;Book C&quot;, &quot;Book D&quot;]<br>let readBooks = [&quot;Book B&quot;, &quot;Book D&quot;]<br>for book in books {<br>    if readBooks.contains(book) {<br>        continue<br>    }<br>    print(&quot;Reading \(book)&quot;)<br>}<br>// Output:<br>// Reading Book A<br>// Reading Book C</pre><p><strong>Break</strong></p><p>The break statement ends the execution of an entire control flow statement immediately.</p><p>Imagine you’re at a buffet, trying different dishes, but you want to stop once you find your favorite:</p><pre>let dishes = [&quot;Salad&quot;, &quot;Soup&quot;, &quot;Pasta&quot;, &quot;Pizza&quot;]<br>let favorite = &quot;Pasta&quot;<br>for dish in dishes {<br>    if dish == favorite {<br>        print(&quot;Found my favorite: \(dish)!&quot;)<br>        break<br>    }<br>    print(&quot;Trying \(dish)&quot;)<br>}<br>// Output:<br>// Trying Salad<br>// Trying Soup<br>// Found my favorite: Pasta!</pre><p><strong>Fallthrough</strong></p><p>The fallthrough keyword causes code execution to continue to the next case in a switch statement.</p><p>Imagine you’re categorizing a score and you want to add additional comments if the score is very high:</p><pre>let score = 85<br>var description = &quot;Score: \(score) is&quot;<br>switch score {<br>case 0..&lt;50:<br>    description += &quot; below average.&quot;<br>case 50..&lt;75:<br>    description += &quot; average.&quot;<br>    fallthrough<br>case 75..&lt;100:<br>    description += &quot; above average.&quot;<br>    fallthrough<br>default:<br>    description += &quot; an excellent performance!&quot;<br>}<br>print(description)<br>// Output:<br>// Score: 85 is above average. an excellent performance!</pre><p><strong>Labeled Statements</strong></p><p>Labeled statements can be used with break and continue to specify which loop or conditional statement you want to affect.</p><p>Imagine you’re in a treasure hunt game with nested loops for different regions and locations, and you want to break out of both loops once you find the treasure:</p><pre>let regions = [&quot;Forest&quot;, &quot;Desert&quot;]<br>let locations = [&quot;Cave&quot;, &quot;Oasis&quot;, &quot;Mountain&quot;]<br>outerLoop: for region in regions {<br>    for location in locations {<br>        if location == &quot;Oasis&quot; &amp;&amp; region == &quot;Desert&quot; {<br>            print(&quot;Found the treasure at the \(location) in the \(region)!&quot;)<br>            break outerLoop<br>        }<br>        print(&quot;Searching \(location) in the \(region)&quot;)<br>    }<br>}<br>// Output:<br>// Searching Cave in the Forest<br>// Searching Oasis in the Forest<br>// Searching Mountain in the Forest<br>// Searching Cave in the Desert<br>// Found the treasure at the Oasis in the Desert!</pre><h3>Early Exits</h3><p><strong>Guard statements</strong> transfer control out of a scope if conditions aren’t met.</p><p>Imagine you’re organizing a party and you need to check if all necessary preparations are done:</p><pre>func organizeParty(preparations: [String: String]) {<br>    guard let venue = preparations[&quot;venue&quot;] else {<br>        print(&quot;No venue selected, can&#39;t organize the party.&quot;)<br>        return<br>    }<br><br>    guard let date = preparations[&quot;date&quot;] else {<br>        print(&quot;No date set, can&#39;t organize the party.&quot;)<br>        return<br>    }<br><br>    print(&quot;Party is organized at \(venue) on \(date).&quot;)<br>}<br>organizeParty(preparations: [&quot;venue&quot;: &quot;Beach&quot;, &quot;date&quot;: &quot;Saturday&quot;])<br>// Output:<br>// Party is organized at Beach on Saturday.</pre><h3>Deferred Actions</h3><p><strong>Defer blocks</strong> execute code just before the current scope exits.</p><p>Imagine you’re writing a report and want to ensure you save your work before you close the document:</p><pre>func writeReport() {<br>    print(&quot;Start writing report&quot;)<br>    defer {<br>        print(&quot;Saving the report&quot;)<br>    }<br>    print(&quot;Writing content&quot;)<br>    // Defer block will execute here, before the function exits<br>}<br>writeReport()<br>// Output:<br>// Start writing report<br>// Writing content<br>// Saving the report</pre><h3>Checking API Availability</h3><p>Swift’s built-in API availability checks ensure you don’t use unavailable APIs for a given deployment target.</p><p>Imagine you’re developing an app and want to use features available only in the latest iOS:</p><pre>if #available(iOS 15, *) {<br>    // Use iOS 15 features<br>    print(&quot;Using iOS 15 features&quot;)<br>} else {<br>    // Fallback for older versions<br>    print(&quot;Using fallback features&quot;)<br>}<br>// Output will depend on the iOS version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*ztq8MxPWK6MWlVV7mFP0AQ.jpeg" /></figure><h3>Join the Conversation 💬</h3><ul><li><strong>Share Your Journey</strong>: Comment below with your experiences learning Swift. What projects have you worked on?</li><li><strong>Follow for More</strong>: Stay tuned for more in-depth articles and tutorials on Swift development.</li><li><strong>Spread the Word</strong>: Share this post with fellow developers to spread the knowledge and excitement about Swift!</li></ul><h3>Conclusion 🎉</h3><p><strong>Ami:</strong> Wow, Siri! Understanding control flow really makes coding much more dynamic and efficient. I feel like I can control my code better now!</p><p><strong>Siri:</strong> Absolutely, Ami! Control flow is crucial for directing your code to do exactly what you want, when you want it. Remember, coding without control flow is like trying to navigate a maze with your eyes closed.</p><p><strong>Ami:</strong> And nobody likes bumping into walls! Thanks, Siri. Can’t wait to see what’s next.</p><p><strong>Siri:</strong> Stay tuned, Ami! The journey continues, and the next adventure in Swift will be just as exciting.</p><p><strong>Ami:</strong> Looking forward to it! And to all my fellow developers, keep coding and keep controlling your flow!</p><h3>Connect with Me 🤝</h3><ul><li><strong>LinkedIn</strong>: <a href="https://www.linkedin.com/in/amitesh">Amitesh’s LinkedIn</a></li><li><strong>Instagram</strong>: <a href="https://www.instagram.com/amitesh">Amitesh’s Instagram</a></li><li><strong>GitHub</strong>: <a href="https://github.com/amitesh">Amitesh’s GitHub</a></li></ul><p>Let’s connect and grow together! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27f034c40049" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift Collections Unleashed: Comprehensive Insights into Arrays, Sets, and Dictionaries]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.stackademic.com/swift-collections-unleashed-comprehensive-insights-into-arrays-sets-and-dictionaries-8b10474f8c00?source=rss-b2b03db21a35------2"><img src="https://cdn-images-1.medium.com/max/1600/1*ok3x8HYWLGTvWknKMm71xQ.jpeg" width="1600"></a></p><p class="medium-feed-snippet">&#x201C;Code is like humor. When you have to explain it, it&#x2019;s bad.&#x201D;&#x200A;&#x2014;&#x200A;Cory House</p><p class="medium-feed-link"><a href="https://blog.stackademic.com/swift-collections-unleashed-comprehensive-insights-into-arrays-sets-and-dictionaries-8b10474f8c00?source=rss-b2b03db21a35------2">Continue reading on Stackademic »</a></p></div>]]></description>
            <link>https://blog.stackademic.com/swift-collections-unleashed-comprehensive-insights-into-arrays-sets-and-dictionaries-8b10474f8c00?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b10474f8c00</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Wed, 31 Jul 2024 15:48:06 GMT</pubDate>
            <atom:updated>2024-08-23T19:11:21.996Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Mastering Swift Basics: A Guide to Variables, Constants, and Data Types]]></title>
            <link>https://appdevbyamitesh.medium.com/mastering-swift-basics-a-guide-to-variables-constants-and-data-types-f61c9d285793?source=rss-b2b03db21a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/f61c9d285793</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Amitesh Mani Tiwari]]></dc:creator>
            <pubDate>Sat, 27 Jul 2024 06:51:32 GMT</pubDate>
            <atom:updated>2024-08-03T20:21:30.478Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“The beautiful thing about learning is that nobody can take it away from you.” — B.B. King</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ok3x8HYWLGTvWknKMm71xQ.jpeg" /><figcaption><a href="https://www.instagram.com/appdevbyamitesh/">AppDevByAmitesh</a></figcaption></figure><h4>Introduction</h4><p>Hey there, tech enthusiasts! 👋 I’m Amitesh Mani Tiwari, a Software Engineer (iOS Team) at Angel One📈 with 2.5 years of experience. Over the years, I’ve delivered 35+ tech and non-tech talks 🎤, mentored at hackathons 👨‍💻, and impacted over 9000 students. Oh, and I was also honored as a 21U21 Award Winner! 💖</p><p>Before we dive into the Swift basics, make sure to check out my previous blog, <a href="https://appdevbyamitesh.medium.com/xcode-unleashed-installation-and-configuration-made-easy-74525aa0e988">Xcode Unleashed: Installation and Configuration Made Easy</a>. It’s a comprehensive guide to setting up your development environment, and it’s a must-read before jumping into the world of Swift programming. Now, let’s start with a little fun conversation to set the stage!</p><h3>A Developer’s Tale: The Basics of Swift 🛤️</h3><p><strong>Ami:</strong> Hey Siri, I’m all set with Xcode. What’s next on my Swift journey?”</p><p><strong>Siri:</strong> Well, Ami, it’s time to get your basics right. Let’s start with variables, constants, and data types.</p><p><strong>Ami:</strong> Sounds like a plan! But why do we need variables and constants anyway?</p><p><strong>Siri:</strong> Imagine baking a cake without ingredients, Ami. Variables and constants are like the ingredients in your recipe — essential for making anything useful.</p><p><strong>Ami:</strong> Got it, Siri! Let’s dive into the details. Can we do all this in the Swift playground?</p><p><strong>Siri:</strong> Absolutely, Ami! The Swift playground is a fantastic tool for experimenting with Swift code. It provides an interactive environment where you can see your code in action as you write it. Perfect for learning and testing your basics.</p><p><strong>Ami:</strong> Awesome! Let’s get started with the basics in the playground. This is going to be fun! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*H9MI-ctupYBBc5BjCict9w.gif" /><figcaption><a href="https://www.instagram.com/appdevbyamitesh/">AppDevByAmitesh</a></figcaption></figure><h3>Why We Need Variables and Constants</h3><p>In Swift, variables and constants are fundamental building blocks that allow you to store and manipulate data. They provide a way to label and refer to values that your program uses, making your code more readable and manageable.</p><ul><li><strong>Variables</strong>: These are used to store values that can change during the execution of your program.</li><li><strong>Constants</strong>: These are used to store values that remain the same throughout the execution of your program.</li></ul><h3>Understanding Variables and Constants</h3><h4>Variables: Mutable and Versatile</h4><p>Variables in Swift are declared using the var keyword. They are mutable, meaning their values can be changed after they are set.</p><pre>var greeting = &quot;Hello, world!&quot;<br>greeting = &quot;Hi, universe!&quot;</pre><h4>Constants: Immutable and Reliable</h4><p>Constants in Swift are declared using the let keyword. They are immutable, meaning once they are set, their values cannot be changed.</p><pre>let pi = 3.14159<br>// pi = 3.14 // This will cause an error</pre><h3>Data Types in Swift</h3><p>Swift is a type-safe language, which means it helps you catch and fix errors early in the development process. Here are some common data types in Swift.</p><ul><li><strong>Int</strong>: Represents integer values.</li></ul><pre>var age: Int = 25</pre><ul><li><strong>Double and Float</strong>: Represent floating-point numbers. Double has double the precision of Float.</li></ul><pre>var pi: Double = 3.14159<br>var speed: Float = 42.0</pre><ul><li><strong>Bool</strong>: Represents boolean values (true or false).</li></ul><pre>var isLoggedIn: Bool = true</pre><ul><li><strong>String</strong>: Represents a sequence of characters.</li></ul><pre>var name: String = &quot;Ami&quot;</pre><ul><li><strong>Array</strong>: Represents a collection of values of the same type.</li></ul><pre>var fruits: [String] = [&quot;Apple&quot;, &quot;Banana&quot;, &quot;Cherry&quot;]</pre><ul><li><strong>Dictionary</strong>: Represents a collection of key-value pairs.</li></ul><pre>var user: [String: String] = [&quot;name&quot;: &quot;Ami&quot;, &quot;job&quot;: &quot;Developer&quot;]</pre><p>Swift’s type inference allows you to omit the type if the compiler can infer it from the context.</p><h3>Collections Types in Swift</h3><p>Swift provides three primary collection types, known as arrays, sets, and dictionaries, for storing collections of values.</p><h4>Arrays: Your Recipe Ingredients List 🍲</h4><p>Arrays store ordered lists of values. The same value can appear multiple times at different positions.</p><pre>var ingredients = [&quot;Flour&quot;, &quot;Sugar&quot;, &quot;Butter&quot;]<br>ingredients.append(&quot;Eggs&quot;)<br>ingredients += [&quot;Milk&quot;, &quot;Vanilla&quot;]<br>print(ingredients)<br>// Prints: [&quot;Flour&quot;, &quot;Sugar&quot;, &quot;Butter&quot;, &quot;Eggs&quot;, &quot;Milk&quot;, &quot;Vanilla&quot;]</pre><blockquote>💡 Pro Tip: Arrays are mutable when assigned to a variable (var), and immutable when assigned to a constant (let).</blockquote><h4>Sets: Your Unique Superpower Collection 💪</h4><p>Sets store distinct values with no defined order. Use a set when the order isn’t important and duplicates aren’t allowed.</p><pre>var superPowers: Set = [&quot;Invisibility&quot;, &quot;Flight&quot;, &quot;Telepathy&quot;]<br>superPowers.insert(&quot;Strength&quot;)<br>superPowers.remove(&quot;Flight&quot;)<br>print(superPowers)<br>// Prints: [&quot;Invisibility&quot;, &quot;Telepathy&quot;, &quot;Strength&quot;]</pre><blockquote>💡 Pro Tip: Sets are perfect for tasks like managing unique user IDs or filtering duplicate entries.</blockquote><h4>Dictionaries: Your Secret Agent Codebook 🕵️‍♂️</h4><p>Dictionaries store associations between keys and values. Each key must be unique.</p><pre>var agentCodes: [String: String] = [&quot;007&quot;: &quot;James Bond&quot;, &quot;001&quot;: &quot;Jack Ryan&quot;]<br>agentCodes[&quot;002&quot;] = &quot;Jason Bourne&quot;<br>agentCodes[&quot;007&quot;] = &quot;Ethan Hunt&quot; // Update value for 007<br>print(agentCodes)<br>// Prints: [&quot;001&quot;: &quot;Jack Ryan&quot;, &quot;007&quot;: &quot;Ethan Hunt&quot;, &quot;002&quot;: &quot;Jason Bourne&quot;]</pre><blockquote>💡 Pro Tip: Dictionaries are ideal for lookups, such as a phone book or a configuration settings map.</blockquote><h3>Unicode Representations of Strings</h3><p>Understanding Unicode representations is crucial for working with international text, emojis, and complex scripts in your apps. Let’s explore this with a fun example featuring everyone’s favorite pet: a cat! 🐱</p><h4>UTF-8 Representation</h4><p>UTF-8 encodes each character using 8-bit code units. It’s efficient for English text but can handle any Unicode character.</p><pre>let catString = &quot;Cat‼🐱&quot;<br>for codeUnit in catString.utf8 {<br>    print(&quot;\(codeUnit) &quot;, terminator: &quot;&quot;)<br>}<br>// Prints &quot;67 97 116 226 128 188 240 159 144 177&quot;</pre><p>Imagine your cat is an international celebrity, known as “Cat‼🐱” around the globe. The first three codeUnit values (67, 97, 116) are the UTF-8 representation of “Cat”, just like their ASCII values. The next three values (226, 128, 188) represent the DOUBLE EXCLAMATION MARK, and the last four values (240, 159, 144, 177) are the UTF-8 bytes for the CAT FACE emoji.</p><h4>UTF-16 Representation</h4><p>UTF-16 uses 16-bit code units. It’s a middle ground, more efficient for texts with many non-ASCII characters.</p><pre>for codeUnit in catString.utf16 {<br>    print(&quot;\(codeUnit) &quot;, terminator: &quot;&quot;)<br>}<br>// Prints &quot;67 97 116 8252 55357 56375&quot;</pre><p>In UTF-16, the DOUBLE EXCLAMATION MARK is represented as a single 16-bit code unit (8252), while the CAT FACE emoji is split into a surrogate pair (55357, 56375).</p><h4>Unicode Scalar Representation</h4><p>Access the 21-bit Unicode scalar values directly. It’s the most straightforward representation, showing each character’s unique code.</p><pre>for scalar in catString.unicodeScalars {<br>    print(&quot;\(scalar.value) &quot;, terminator: &quot;&quot;)<br>}<br>// Prints &quot;67 97 116 8252 128049&quot;</pre><p>Here, each character is represented by its Unicode scalar value. The CAT FACE emoji has a value of 128049, showing its direct Unicode representation.</p><p>These representations help ensure your app handles text correctly across all languages and symbols, making your international cat a true star!</p><h3>Join the Conversation 💬</h3><ul><li><strong>Share Your Journey</strong>: Comment below with your experiences learning Swift. What projects have you worked on?</li><li><strong>Follow for More</strong>: Stay tuned for more in-depth articles and tutorials on Swift development.</li><li><strong>Spread the Word</strong>: Share this post with fellow developers to spread the knowledge and excitement about Swift!</li></ul><h3>Conclusion 🎉</h3><p><strong>Ami:</strong> “Wow, Siri, understanding variables and constants in Swift wasn’t as hard as I thought!”</p><p><strong>Siri:</strong> “Told you so, Ami! With the right basics, you’re all set to create amazing apps.”</p><p><strong>Ami:</strong> “Can’t wait to apply what I’ve learned. Thanks, Siri! 🚀”</p><p><strong>Siri:</strong> “Anytime, Ami! Remember, mastering the basics is the first step to becoming an expert. Happy coding!”</p><h4>Connect with Me 🤝</h4><ul><li><strong>LinkedIn</strong>: <a href="https://www.linkedin.com/in/amitesh">Amitesh’s LinkedIn</a></li><li><strong>Instagram</strong>: <a href="https://www.instagram.com/amitesh">Amitesh’s Instagram</a></li><li><strong>GitHub</strong>: <a href="https://github.com/amitesh">Amitesh’s GitHub</a></li></ul><p>Let’s connect and grow together! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMtm7bQdieyS-HuqgJ1NPw.jpeg" /></figure><h3>Next Up: Deep Dive into Collection Types 🗂️</h3><p>Stay tuned for the next blog where we’ll take a deeper dive into Swift’s collection types — arrays, sets, and dictionaries. We’ll cover:</p><ol><li><strong>Creating and Initializing Collections</strong>: Different ways to create and initialize arrays, sets, and dictionaries.</li><li><strong>Accessing and Modifying Collections</strong>: How to add, remove, and update elements in your collections.</li><li><strong>Iterating Over Collections</strong>: Efficiently looping through arrays, sets, and dictionaries.</li><li><strong>Set Operations</strong>: Performing operations like union, intersection, and difference on sets.</li><li><strong>Practical Examples</strong>: Real-world use cases and examples to illustrate the power and flexibility of Swift’s collections.</li></ol><p>Don’t miss out on mastering these essential tools that will help you build more efficient and powerful Swift applications!</p><p>Stay tuned and keep coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f61c9d285793" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>