<?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 Robert Dresler on Medium]]></title>
        <description><![CDATA[Stories by Robert Dresler on Medium]]></description>
        <link>https://medium.com/@robertdresler?source=rss-caceebc52176------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F3GK9HickZ3tHpWle_ygSA.jpeg</url>
            <title>Stories by Robert Dresler on Medium</title>
            <link>https://medium.com/@robertdresler?source=rss-caceebc52176------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:15:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robertdresler/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[SwiftUI — NavigationStack — Almost Great, But…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@robertdresler/swiftui-is-the-navigationstack-path-approach-incorrect-70ab8df8f5ac?source=rss-caceebc52176------2"><img src="https://cdn-images-1.medium.com/max/2368/1*x5ZyUMg1ITBUAq53N5QXAg.png" width="2368"></a></p><p class="medium-feed-snippet">SwiftUI&#x2019;s NavigationStack is a powerful addition, but it lacks built-in support for changing the root dynamically. This solves the problem!</p><p class="medium-feed-link"><a href="https://medium.com/@robertdresler/swiftui-is-the-navigationstack-path-approach-incorrect-70ab8df8f5ac?source=rss-caceebc52176------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@robertdresler/swiftui-is-the-navigationstack-path-approach-incorrect-70ab8df8f5ac?source=rss-caceebc52176------2</link>
            <guid isPermaLink="false">https://medium.com/p/70ab8df8f5ac</guid>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Robert Dresler]]></dc:creator>
            <pubDate>Tue, 11 Feb 2025 18:44:02 GMT</pubDate>
            <atom:updated>2025-02-13T09:52:49.199Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Choosing the Right SwiftUI Navigation Solution]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@robertdresler/choosing-the-right-swiftui-navigation-solution-3a790413f531?source=rss-caceebc52176------2"><img src="https://cdn-images-1.medium.com/max/2600/1*HLjii16UKPqWeg5uAfYzfg.png" width="2818"></a></p><p class="medium-feed-snippet">Are you building Views with SwiftUI but haven&#x2019;t yet figured out how to implement navigation? Discover what you need to consider when&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@robertdresler/choosing-the-right-swiftui-navigation-solution-3a790413f531?source=rss-caceebc52176------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@robertdresler/choosing-the-right-swiftui-navigation-solution-3a790413f531?source=rss-caceebc52176------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a790413f531</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Robert Dresler]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 19:41:26 GMT</pubDate>
            <atom:updated>2025-02-26T18:31:01.412Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Clean SwiftUI Modals presentation]]></title>
            <link>https://medium.com/@robertdresler/clean-swiftui-modals-presentation-8bcd2c5fe096?source=rss-caceebc52176------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bcd2c5fe096</guid>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Robert Dresler]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 09:22:04 GMT</pubDate>
            <atom:updated>2025-02-06T09:29:13.339Z</atom:updated>
            <content:encoded><![CDATA[<h3>What are Modals</h3><p>The purpose of a stack navigation is to maintain the user’s navigation experience without interruption, whereas modals serve the opposite function. Modal can be thought of as an element that disrupts the current navigation flow, directing the user’s attention to a new standalone task — such as editing a profile or starting a workout. Ideal examples of modals include full-screen covers, sheets, alerts, and popovers¹.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*Zp3D1zJhvPO9oJwWPQxPZA@2x.png" /><figcaption>Source: <a href="https://developer.apple.com/documentation/swiftui/modal-presentations">Modal presentations</a></figcaption></figure><h3>How it works in SwiftUI</h3><p>In SwiftUI, navigating in this manner involves applying ViewModifers directly to your View. Such modifiers consist of fullScreenCover, sheet, alert, among others. They take a Binding as an argument, which determines if the modal is presented.</p><h3>Problem</h3><p>It is crucial to note that since a modal represents a new focused and independent task, presenting two modals simultaneously from one view is not possible, even though SwiftUI’s declarative syntax theoretically permits it.</p><pre>var body: some View {<br>    ...<br>        .fullScreenCover(isPresented: $isFullScreenCoverPresented) { ... }<br>        .sheet(isPresented: $isSheetPresented) { ... }<br>}</pre><h3>Single state</h3><p>A possible solution to this problem is to maintain a single state, such as destination which hold some enum, and leverage <a href="https://github.com/pointfreeco/swift-case-paths">swift-case-paths</a> to manage it effectively.</p><pre>var body: some View {<br>    ...<br>        .fullScreenCover(item: $destination.destinationA) { _ in ... }<br>        .sheet(item: $destination.destinationB) { _ in ... }<br>}</pre><h3>Separating navigation logic</h3><p>Implementing this concept may not be straightforward for many developers, so I created a framework that separates navigation from the presentation (UI) logic — <a href="https://github.com/RobertDresler/SwiftUINavigation"><strong>SwiftUINavigation</strong></a>.</p><p>This framework allows you to define a separate model dedicated to navigation logic, called <strong>NavigationModel</strong>, which handles navigating between different screens. You can perform actions on this model to modify the navigation graph, such as present, which sets the presentedModel.</p><p>This presentedModel holds your newly presented NavigationModel in PresentedNavigationModel and can be representing fullScreenCover, sheet, alert, or your custom presentedModel like when presenting PhotosPicker .</p><p>This approach guarantees that there is always only one active presentedModel at a time while ensuring that NavigationModel hierarchy within the current task maintains a single presentedModel. This still allows for nested presentations, such as opening a name editor from a profile editor, which itself is presented from the profile screen.</p><pre>@NavigationModel<br>final class ProfileNavigationModel {<br><br>    ...<br><br>    func showEditor() {<br>        // Present fullScreenCover<br>        execute(.present(.fullScreenCover(.stacked(ProfileEditorNavigationModel()))))<br>        // Present sheet<br>        execute(.present(.sheet(.stacked(ProfileEditorNavigationModel()))))<br>        // Present sheet with editor and pushed connected services detail from the editor<br>        execute(.present(.sheet(.stacked([ProfileEditorNavigationModel(), ConnectedServicesDetailNavigationModel()])))<br>        // Present not wrapped in stack<br>        execute(.present(.sheet(SFSafariNavigationModel(...))))<br>        // Present sheet and then immediately present another one<br>        let presentedModel = ProfileEditorNavigationModel()<br>        execute(.present(.sheet(.stacked(presentedModel))))<br>        presentedModel.execute(.present(.sheet(.stacked(NameEditorNavigationModel()))))<br>    }<br><br>}<br><br>struct ProfileView: View {<br><br>    @EnvironmentNavigationModel private var navigationModel: ProfileNavigationModel<br><br>    var body: some View {<br>        Button(&quot;Show editor&quot;) {<br>            navigationModel.showEditor()<br>        }<br>    }<br><br>}</pre><p>This solution also allows you to modify the stack where is profile, even while its editor is presented.</p><h3>SwiftUINavigation framework</h3><p>The <a href="https://github.com/RobertDresler/SwiftUINavigation"><strong>SwiftUINavigation</strong></a> framework is available as a package on <a href="https://github.com/RobertDresler/SwiftUINavigation">GitHub</a> and offers many features, including NavigationStack and TabView management. It also supports step-by-step flows, such as onboarding, and enables content-driven navigation for deep linking.</p><p>This framework provides tools for implementing clean and structured navigation and is compatible with any architecture, including MV and MVVM.</p><p>Link is here: <a href="https://github.com/RobertDresler/SwiftUINavigation">https://github.com/RobertDresler/SwiftUINavigation</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*VQ8npaTtwPBv3LDtkIgBrw.png" /></figure><p>[1] <a href="https://developer.apple.com/videos/play/wwdc2022/10001">https://developer.apple.com/videos/play/wwdc2022/10001</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bcd2c5fe096" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean SwiftUI Navigation]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@robertdresler/clean-swiftui-navigation-bdefbceb0d62?source=rss-caceebc52176------2"><img src="https://cdn-images-1.medium.com/max/677/1*5XJqNqoiyZdWzLLyBEBiXw.png" width="677"></a></p><p class="medium-feed-link"><a href="https://medium.com/@robertdresler/clean-swiftui-navigation-bdefbceb0d62?source=rss-caceebc52176------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@robertdresler/clean-swiftui-navigation-bdefbceb0d62?source=rss-caceebc52176------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdefbceb0d62</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios-development]]></category>
            <dc:creator><![CDATA[Robert Dresler]]></dc:creator>
            <pubDate>Sun, 19 Jan 2025 13:29:33 GMT</pubDate>
            <atom:updated>2025-02-26T18:31:46.612Z</atom:updated>
        </item>
    </channel>
</rss>