<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yossa Bourne</title>
    <description>The latest articles on DEV Community by Yossa Bourne (@yossabourne).</description>
    <link>https://dev.to/yossabourne</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F488594%2F214ec5b6-70e2-44db-86c1-35e56791868c.jpg</url>
      <title>DEV Community: Yossa Bourne</title>
      <link>https://dev.to/yossabourne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yossabourne"/>
    <language>en</language>
    <item>
      <title>SwiftUI Complex Animations - Lume GPT Weather UI - Matched Geometry Effect [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Wed, 23 Apr 2025 10:17:11 +0000</pubDate>
      <link>https://dev.to/yossabourne/swiftui-complex-animations-lume-gpt-weather-ui-matched-geometry-effect-video-3377</link>
      <guid>https://dev.to/yossabourne/swiftui-complex-animations-lume-gpt-weather-ui-matched-geometry-effect-video-3377</guid>
      <description>&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/6_M_4fpE2T4"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Let’s do the first animation challenge inspired by Lume GPT Weather iOS app! In this video, I’ll walk you through creating complex animations and interfaces in SwiftUI using various techniques such as matched geometry effect, delay-based list animations, adjusting view’s darkness, and more!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you’ll learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Synchronizing animations using .matchedGeometryEffect&lt;/li&gt;
&lt;li&gt;Delay-based animations&lt;/li&gt;
&lt;li&gt;Sizing layout based on container using .containerRelativeFrame&lt;/li&gt;
&lt;li&gt;Complex animations&lt;/li&gt;
&lt;li&gt;Adjusting view’s brightness / darkness&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;YouTube - AppBeyond&lt;/a&gt; for more contents!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>MV vs MVVM in SwiftUI (2025): Which Architecture Should You Use? [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Sun, 06 Apr 2025 05:12:42 +0000</pubDate>
      <link>https://dev.to/yossabourne/mv-vs-mvvm-in-swiftui-2025-which-architecture-should-you-use-video-26nb</link>
      <guid>https://dev.to/yossabourne/mv-vs-mvvm-in-swiftui-2025-which-architecture-should-you-use-video-26nb</guid>
      <description>&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/AyAUTNxKArw"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Which to choose: MV or MVVM? In this video, I’ll show to how to implement both patterns and guide you how to choose between these two in 2025.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you’ll learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What’s in an iOS app&lt;/li&gt;
&lt;li&gt;MV (Model-View) or VV (View-View) Pattern in action&lt;/li&gt;
&lt;li&gt;MVVM Pattern in action&lt;/li&gt;
&lt;li&gt;Choosing between MV and MVVM&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>It's 2025 and I still see people use NavigationLink in SwiftUI. Let's find out why you should AVOID it instead and use better alternatives!</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Tue, 11 Mar 2025 03:16:52 +0000</pubDate>
      <link>https://dev.to/yossabourne/its-2025-and-i-still-see-people-use-navigationlink-in-swiftui-lets-find-out-why-you-should-avoid-3emd</link>
      <guid>https://dev.to/yossabourne/its-2025-and-i-still-see-people-use-navigationlink-in-swiftui-lets-find-out-why-you-should-avoid-3emd</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/yossabourne" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F488594%2F214ec5b6-70e2-44db-86c1-35e56791868c.jpg" alt="yossabourne"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/yossabourne/swiftui-navigation-never-use-navigationlink-with-navigationstack-ip8" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;SwiftUI Navigation: NEVER use NavigationLink with NavigationStack&lt;/h2&gt;
      &lt;h3&gt;Yossa Bourne ・ Mar 10&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#ios&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#swift&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#discuss&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Complete Guide to Navigation in SwiftUI with NavigationStack [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Tue, 11 Mar 2025 02:04:44 +0000</pubDate>
      <link>https://dev.to/yossabourne/complete-guide-to-navigation-in-swiftui-with-navigationstack-3npn</link>
      <guid>https://dev.to/yossabourne/complete-guide-to-navigation-in-swiftui-with-navigationstack-3npn</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/_DkQLW9UV3A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Master SwiftUI navigation with NavigationStack! In this video, you'll learn fundamental of navigation in SwiftUI and NavigationStack. I’ll show you how to navigate using different methods, from simple to advanced! Whether you're a beginner or an experienced developer, this tutorial will help you understand navigation in SwiftUI and help you build better apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you’ll learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fundamental of navigation in SwiftUI and NavigationStack&lt;/li&gt;
&lt;li&gt;How to use NavigationLink and why you should avoid using it&lt;/li&gt;
&lt;li&gt;How to navigate programmatically&lt;/li&gt;
&lt;li&gt;How to pass data on navigation between views&lt;/li&gt;
&lt;li&gt;How to support navigation with multiple data types&lt;/li&gt;
&lt;li&gt;How to remove view programmatically&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SwiftUI Navigation: NEVER use NavigationLink with NavigationStack</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Mon, 10 Mar 2025 19:27:32 +0000</pubDate>
      <link>https://dev.to/yossabourne/swiftui-navigation-never-use-navigationlink-with-navigationstack-ip8</link>
      <guid>https://dev.to/yossabourne/swiftui-navigation-never-use-navigationlink-with-navigationstack-ip8</guid>
      <description>&lt;p&gt;Back then in the dark age prior to iOS 16, performing navigation in pure SwiftUI was evil, especially for those who came from UIKit. There was only one way to navigate was to use &lt;code&gt;NavigationView&lt;/code&gt; + &lt;code&gt;NavigationLink&lt;/code&gt;, the duo full of awful properties.&lt;/p&gt;

&lt;p&gt;Fortunately, &lt;code&gt;NavigationStack&lt;/code&gt; made its first debut in iOS 16 with a huge improvement. It alleviate a lot of issues we had with &lt;code&gt;NavigationView&lt;/code&gt; + &lt;code&gt;NavigationLink&lt;/code&gt; disastrous pair. What’s the best is we can use &lt;code&gt;NavigationStack&lt;/code&gt; ALONE to perform navigation in pure SwiftUI. Since &lt;code&gt;NavigationStack&lt;/code&gt; is better than &lt;code&gt;NavigationView&lt;/code&gt; in every aspect, &lt;code&gt;NavigationView&lt;/code&gt; is deprecated. But its friend — &lt;code&gt;NavigationLink&lt;/code&gt; — is not…&lt;/p&gt;

&lt;p&gt;Even though it’s bad and we’ve already had &lt;code&gt;NavigationStack&lt;/code&gt;, I still see &lt;code&gt;NavigationLink&lt;/code&gt; from time to time to time. That’s why I write this article to tell you…&lt;/p&gt;

&lt;h2&gt;
  
  
  These are 3 reasons why you SHOULDN’T use NavigationLink with NavigationStack
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Eager View Initialization
&lt;/h3&gt;

&lt;p&gt;When we use &lt;code&gt;NavigationLink&lt;/code&gt; to link between the source and the destination views, it creates the destination view instance before it’s actually added to the view hierarchy. This leads to performance issues in real life when we construct a large number of views.&lt;/p&gt;

&lt;p&gt;Let’s take a look at the following example, it prints to the console immediately without any interaction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;ContentView&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;NavigationStack&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;NavigationLink&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;ExampleView&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Destination&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nv"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Tap to navigate"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Source&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;ExampleView&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"init"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;--- This would be printed out before we tap the source view&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The console printed out as soon as the preview finished loading:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExeXNiMWRkajNkMHFuY3p2YnN0Y2M4cTh5NXk5ZGp2NW9mMGdjdnVucCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FR9co1z4ynG6u0VPNhs%2Fgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExeXNiMWRkajNkMHFuY3p2YnN0Y2M4cTh5NXk5ZGp2NW9mMGdjdnVucCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FR9co1z4ynG6u0VPNhs%2Fgiphy.gif" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It would be even worse if each destination view initializes it own dependencies directly (i.e. containing &lt;code&gt;@StateObject&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Solution? Use &lt;code&gt;NavigationStack&lt;/code&gt; with &lt;code&gt;.navigationDestination&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;ContentView&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;@State&lt;/span&gt; &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;NavigationPath&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;NavigationStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;$path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Destination&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nv"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Tap to navigate"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Source&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationDestination&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;for&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Destination&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;
                &lt;span class="kt"&gt;ExampleView&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Destination&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;enum&lt;/span&gt; &lt;span class="kt"&gt;Destination&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After fixing, the log is printed out after I tapped the button to navigate:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaTc2c3Buanp0ZG40eW1yMGJ1YzBpN2V6cWYxcTR6MHNyem51NnBvZiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3sqZSW6R61AYXXD1C4%2Fgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaTc2c3Buanp0ZG40eW1yMGJ1YzBpN2V6cWYxcTR6MHNyem51NnBvZiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3sqZSW6R61AYXXD1C4%2Fgiphy.gif" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This solution brings us to the next point.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. ANTI Programmatic Navigation
&lt;/h3&gt;

&lt;p&gt;Most apps need programmatic navigation. It’s a crucial part for providing seamless experience in the app. These features (but not limited to) require the ability to navigate programmatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asynchronous Navigation (i.e. go to the next screen after loading data from network)&lt;/li&gt;
&lt;li&gt;Deep Linking&lt;/li&gt;
&lt;li&gt;Handle push notifications (i.e. navigate to a certain screen after tapping a push notification)&lt;/li&gt;
&lt;li&gt;App Intents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unfortunately, it’s nearly impossible to achieve that capability with NavigationLink, and don’t try it at home if your app supports minimum iOS newer than 16.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NavigationStack&lt;/code&gt; and &lt;code&gt;NavigationPath&lt;/code&gt; support programmatic navigation by design. This is how we easily achieve deep link handling with these wonderful duo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;ContentView&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;@State&lt;/span&gt; &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;NavigationPath&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;NavigationStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;$path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;YourRootView&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;--- Source / Root&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;navigationDestination&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;for&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Destination&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;
                    &lt;span class="kt"&gt;ExampleView&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;--- Destination&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="c1"&gt;// 1. Use .onOpenURL(_:) to detect incoming URL.&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;onOpenURL&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; 
            &lt;span class="c1"&gt;// 2. Handle the incoming URL using a custom method.&lt;/span&gt;
            &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="nv"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// 3. Check if the URL is valid&lt;/span&gt;
        &lt;span class="c1"&gt;// For example, we only allow appduck://example.&lt;/span&gt;
        &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scheme&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"appduck"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;components&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"example"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; 

        &lt;span class="c1"&gt;// 4. Finally, perform an action corresponding to the URL.&lt;/span&gt;
        &lt;span class="c1"&gt;// In this case, show ExampleView.&lt;/span&gt;
        &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Destination&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;enum&lt;/span&gt; &lt;span class="kt"&gt;Destination&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. No Room for Additional Actions
&lt;/h3&gt;

&lt;p&gt;If you have experience working on complex apps, you know that one button often do more than one thing, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asynchronous Operation (i.e. silently save data to the database)&lt;/li&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;li&gt;Analytics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s pretty common if it’s a button made of &lt;code&gt;Button&lt;/code&gt;, not &lt;code&gt;NavigationLink&lt;/code&gt;. According to &lt;a href="https://developer.apple.com/documentation/swiftui/navigationlink" rel="noopener noreferrer"&gt;its documentation&lt;/a&gt;, none of its signatures accept functions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabl41rr1d92aorbkwgos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabl41rr1d92aorbkwgos.png" alt="NavigationLink Documentation" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some developers suggest that we add additional actions to the destination view’s &lt;code&gt;.onAppear()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;ContentView&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;NavigationStack&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;NavigationLink&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;ExampleView&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Destination&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;onAppear&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="nf"&gt;performCustomAction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;--- BAD PRACTICE!!! Don't to this!&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nv"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Tap to navigate"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Source&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For simple apps, that trick might work. If you do that in more complex apps, you’ll end up with either a lot of duplicated code or unreadable one. This problem can be solved easily with &lt;code&gt;NavigationStack&lt;/code&gt; and &lt;code&gt;NavigationPath&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;NavigationLink&lt;/code&gt; is an old API designed for quick prototyping alone. Its downsides make it’s very impractical to use in professional environments.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NavigationStack&lt;/code&gt; and &lt;code&gt;NavigationPath&lt;/code&gt; are currently the best for pure SwiftUI navigation. They are simple and quite powerful. &lt;/p&gt;

&lt;p&gt;However, if you’re looking for a better navigation system supporting SwiftUI views with&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;more performant&lt;/li&gt;
&lt;li&gt;more capable&lt;/li&gt;
&lt;li&gt;more reliable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consider this option: &lt;code&gt;UINavigationController&lt;/code&gt; wrapped in a &lt;code&gt;UIViewControllerRepresentable&lt;/code&gt;.&lt;/p&gt;




&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Stretchy &amp; Sticky Header in SwiftUI on iOS 18 [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Wed, 05 Mar 2025 02:45:00 +0000</pubDate>
      <link>https://dev.to/yossabourne/stretchy-sticky-header-in-swiftui-on-ios-18-video-46g7</link>
      <guid>https://dev.to/yossabourne/stretchy-sticky-header-in-swiftui-on-ios-18-video-46g7</guid>
      <description>&lt;p&gt;Stretchy &amp;amp; sticky header is a very popular UI, and that’s what we’ll build together in this video. Since iOS 17, Apple provides us many simple yet powerful APIs on SwiftUI ScrollView. We’ll use one of that — onScrollGeometryChange — to help us achieve the effect easily.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/G8oRXXLm8h4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;What you’ll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to use .onScrollGeometryChange modifier&lt;/li&gt;
&lt;li&gt;How to implement stretchy &amp;amp; sticky header in SwiftUI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Making 3D Button with Haptic Effect like Duolingo in SwiftUI</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Wed, 26 Feb 2025 14:00:00 +0000</pubDate>
      <link>https://dev.to/yossabourne/making-3d-button-with-haptic-effect-like-duolingo-in-swiftui-2mj9</link>
      <guid>https://dev.to/yossabourne/making-3d-button-with-haptic-effect-like-duolingo-in-swiftui-2mj9</guid>
      <description>&lt;p&gt;In this video, I’ll show you how to make a 3D button with press effect like Duolingo. Later on, we'll add a haptic effect to make the button feels more immersive and satisfying. Don't forget to test it on your real device!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you’ll learn:&lt;/strong&gt;&lt;br&gt;
➡ A simple way to make a 3D button&lt;br&gt;
➡ Using haptic effect in SwiftUI&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fMiGJCv25uA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>mobile</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Mesh Gradient with Animation in SwiftUI [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Tue, 25 Feb 2025 15:37:32 +0000</pubDate>
      <link>https://dev.to/yossabourne/mesh-gradient-with-animation-in-swiftui-video-5bn6</link>
      <guid>https://dev.to/yossabourne/mesh-gradient-with-animation-in-swiftui-video-5bn6</guid>
      <description>&lt;p&gt;In this video, I’ll show you how to create a stunning visual using MeshGradient in SwiftUI. Later in the video, I'll show you various techniques to perform animations with mesh gradient!&lt;/p&gt;

&lt;p&gt;What you’ll learn:&lt;br&gt;
➡ How to create a complex gradient using MeshGradient&lt;br&gt;
➡ Various techniques to perform animations&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/s_y5uEwKRJM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>tutorial</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Auto-Scrolling Infinite Carousel in SwiftUI [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Mon, 24 Feb 2025 02:06:19 +0000</pubDate>
      <link>https://dev.to/yossabourne/auto-scrolling-infinite-carousel-in-swiftui-video-1fjm</link>
      <guid>https://dev.to/yossabourne/auto-scrolling-infinite-carousel-in-swiftui-video-1fjm</guid>
      <description>&lt;p&gt;In this video, I’ll walk you through building a seamless auto-scrolling infinite carousel using SwiftUI and new ScrollView APIs recently introduced in iOS 18. I promise the technique is much simpler than you thought! 🤩&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/xlKJQLpr7GA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you’ll learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to create an infinite scrolling carousel in SwiftUI without keeping adding / removing elements&lt;/li&gt;
&lt;li&gt;How to use recent SwiftUI’s ScrollView APIs, including: scroll position, scroll phase, scroll geometry, and styling! 😎&lt;/li&gt;
&lt;li&gt;How to use Timer to perform repeating tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! &lt;br&gt;
There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Making Dating App Animation in SwiftUI [Video]</title>
      <dc:creator>Yossa Bourne</dc:creator>
      <pubDate>Sun, 23 Feb 2025 12:08:24 +0000</pubDate>
      <link>https://dev.to/yossabourne/making-dating-app-animation-in-swiftui-video-4ng6</link>
      <guid>https://dev.to/yossabourne/making-dating-app-animation-in-swiftui-video-4ng6</guid>
      <description>&lt;p&gt;In this video, I’ll show you how to make dating app animation in SwiftUI. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/d3LfrAtgrnc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first part is recreating a swiping card animations like in popular dating apps such as Tinder and Bumble. In this part, you’ll learn how to use drag gesture with &lt;code&gt;@GestureState&lt;/code&gt; to move multiple views at once to create subtle animations.&lt;/li&gt;
&lt;li&gt;The second part, I’ll make a view showing people liking each other. I’ll walk you through the process on how I create complex animations. Furthermore, I’ll create a particle effect using a powerful SwiftUI library called Vortex, created by Paul Hudson from Hacking with Swift.&lt;/li&gt;
&lt;li&gt;Finally, I’ll combine those views together with SwiftUI navigation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What you’ll learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to use &lt;code&gt;DragGesture&lt;/code&gt; and &lt;code&gt;@GestureState&lt;/code&gt; to perform subtle animations&lt;/li&gt;
&lt;li&gt;SwiftUI translation and transformation view modifiers&lt;/li&gt;
&lt;li&gt;A process to create complex animations&lt;/li&gt;
&lt;li&gt;Installing package using Swift Package Manager&lt;/li&gt;
&lt;li&gt;How to use Vortex to create beautiful particle effects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please subscribe me and &lt;a href="https://www.youtube.com/channel/UCwoAEHdoy4CrSnXZ1GsFlNA" rel="noopener noreferrer"&gt;my channel - AppBeyond&lt;/a&gt; for more videos! There are other videos I've made about cool animations in SwiftUI. I also upload Swift and SwiftUI knowledge videos weekly!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
