<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[iOS Developer Life]]></title><description><![CDATA[Unlocking the world of iOS development,one byte at a time.]]></description><link>https://iosdeveloperlife.com/</link><image><url>https://iosdeveloperlife.com/favicon.png</url><title>iOS Developer Life</title><link>https://iosdeveloperlife.com/</link></image><generator>Ghost 5.13</generator><lastBuildDate>Mon, 13 Apr 2026 15:48:55 GMT</lastBuildDate><atom:link href="https://iosdeveloperlife.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Fix Navigation Link and Navigation View in SwiftUI]]></title><description><![CDATA[<p>SwiftUI 4 and the new NavigationStack in iOS 16 are an excellent solution for pushing views into the navigation hierarchy. However, if your app still needs to support iOS 15, you need to relay on NavigationView. To write a simple navigation hierarchy with couple of views check the following code</p>]]></description><link>https://iosdeveloperlife.com/fix-navigation-link-and-navigation-view-in-swiftui/</link><guid isPermaLink="false">63d629c14e143278566f205a</guid><category><![CDATA[SwiftUI]]></category><category><![CDATA[XCode]]></category><dc:creator><![CDATA[Kosala Jayasekara]]></dc:creator><pubDate>Sun, 29 Jan 2023 10:22:27 GMT</pubDate><media:content url="https://iosdeveloperlife.com/content/images/2023/01/nav-stack-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://iosdeveloperlife.com/content/images/2023/01/nav-stack-1.png" alt="Fix Navigation Link and Navigation View in SwiftUI"><p>SwiftUI 4 and the new NavigationStack in iOS 16 are an excellent solution for pushing views into the navigation hierarchy. However, if your app still needs to support iOS 15, you need to relay on NavigationView. To write a simple navigation hierarchy with couple of views check the following code block, make sure not to add multiple Navigation Views in the same view hierarchy, as this can cause weird glitches, even though it may compile and run.</p><pre><code class="language-swift">struct FirstView: View {
    var body: some View {
        NavigationView {
            VStack {
                NavigationLink(destination: SecondView()) {
                    Text(&quot;Go to Next&quot;)
                }
            }
            .padding()
        }
    }
}

truct SecondView : View{
    var body: some View{
        ZStack{
            VStack{
                //use navigation link without navigation view
                NavigationLink(destination: ThirdView()) {
                    Text(&quot;Next View&quot;)
                }
            }
        }
    }
}

struct ThirdView : View {
    var body: some View{
        ZStack{
            VStack{
                Text(&quot;Third View&quot;)
            }
        }
    }
}
</code></pre><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/RocketSim_Recording_iPhone_14_Pro_2023-01-29_1.37.16_PM.gif" class="kg-image" alt="Fix Navigation Link and Navigation View in SwiftUI" loading="lazy" width="323" height="700"></figure><p></p><p>The NavigationView in SwiftUI provides default back button behavior, which makes it easy to navigate back to the previous view in the navigation hierarchy. However, if you want to use a custom back button, you can use the <code>Environment</code> key path of the <code>presentationMode</code> to dismiss the current view.</p><pre><code class="language-swift">@Environment(\.presentationMode) var presentationMode

	Button {
         presentationMode.wrappedValue.dismiss()
    } label: {
         Text(&quot;Back to Home&quot;)
    }</code></pre><p>When you have a list of data with a large number of items and you use <code>NavigationLink</code> to navigate to a second view that depends on it, there can be performance issues. Initializing the second view with a large number of items can take a significant amount of time and can lead to a slow and laggy user experience. This can be especially problematic on older devices or devices with limited resources.</p><pre><code class="language-swift"> List{
    ForEach(0..&lt;50){ j in
            NavigationLink(destination: SecondView(selectedItem: j)) {
                    Text(&quot;Go to Next \(j)&quot;)
                    }
            }
     }</code></pre><p>To mitigate this issue, you can use techniques such as lazy loading to load only the data that is needed for the current view. This can help reduce the amount of time and resources required to initialize the second view, and can result in a smoother and more responsive user experience.</p><p>Here&apos;s an example of how you could implement lazy Navigation Link with simple hack</p><pre><code class="language-swift">@State var showSecondView : Bool = false
@State var nextItem : Int = 0
    
    var body: some View {
        NavigationView {
            VStack {
                
                List{
                    ForEach(0..&lt;30) { i in
                        HStack {
                            ZStack{
                                Color.white
                                Text(&quot;Go to Next \(i)&quot;)
                            }
                        }.onTapGesture {
                            showNextView(item: i)
                        }
                        
                    }
                }
            }
            .padding()
            .background(
                //Instead of creating navigation link inside loop, use invisible Navigation Link with isActive Binding
                NavigationLink(destination: SecondView(selectedItem: nextItem), isActive: $showSecondView, label: { EmptyView() })
                
            )
        }
    }
    
    private func showNextView(item : Int){
        nextItem = item
        showSecondView.toggle()
    }</code></pre><p>It&apos;s always a good practice to avoid deprecated APIs, as they may have reduced functionality or be removed in future releases. However, sometimes you may need to target older or legacy devices, and in these cases, you may need to find a workaround.</p><p>In the context of navigation in SwiftUI, if your app needs to support older versions of iOS, such as iOS 15, you may need to use the deprecated <code>NavigationView</code> component. However, if you only need to support iOS 16 and above, it&apos;s recommended to use the new <code>NavigationStack</code>, as it provides improved functionality and performance.</p>]]></content:encoded></item><item><title><![CDATA[Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023]]></title><description><![CDATA[<p>As an iOS engineer, I was thrilled to attend the iOSConfSG conference in Singapore for the sixth consecutive year. After two years of virtual events due to COVID-19, it was a special experience to be able to attend in-person and meet with fellow developers from around the world. This year&</p>]]></description><link>https://iosdeveloperlife.com/exploring-singapore-and-the-latest-in-ios-development-my-tour-of-iosconfsg-2023/</link><guid isPermaLink="false">63c9c193236afe039a67fec6</guid><dc:creator><![CDATA[Kosala Jayasekara]]></dc:creator><pubDate>Thu, 19 Jan 2023 22:46:18 GMT</pubDate><media:content url="https://iosdeveloperlife.com/content/images/2023/01/324739120_690215526087080_5784246064094504493_n.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://iosdeveloperlife.com/content/images/2023/01/324739120_690215526087080_5784246064094504493_n.jpg" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023"><p>As an iOS engineer, I was thrilled to attend the iOSConfSG conference in Singapore for the sixth consecutive year. After two years of virtual events due to COVID-19, it was a special experience to be able to attend in-person and meet with fellow developers from around the world. This year&apos;s event included a workshop and conference, providing a wealth of information and opportunities to learn and network.</p><p>The event began with an awesome workshop led by Daniel Steinberg on new Swift Async/Await framework.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/daniel.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/daniel.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/daniel.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/daniel.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/daniel.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>Tunde Adegoroye followed this up with a session on using StoreKit2 to integrate in-app purchases.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/tunde.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/tunde.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/tunde.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/tunde.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/tunde.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>The conference then moved on to the all-new iOS 16 weather API, presented by Betty Godier.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/betty.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/betty.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/betty.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/betty.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/betty.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>Martin Mitrevski delivered an excellent presentation on Swift&apos;s performance and Pradnya Nikam spoke about the performance in drawing shadows in Swift.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/martin.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/martin.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/martin.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/martin.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/martin.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>Erin Weigel discussed new era and R&amp;D topics for developers, and Jordi Bruin shared his 2-2-2 method for developing multiple iOS apps simultaneously.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/erin.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/erin.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/erin.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/erin.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/erin.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/jordi.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/jordi.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/jordi.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/jordi.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/jordi.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>Day two of the conference was equally exciting. Mikaela Caron kickstarted the conference by delivering her speech about app data and cloud solutions. Paul Hudson, the well-known Swift guru, explained how Swift and iOS Development are affected by the man vs AI game. Omar Khaled shared his experiences with handling traffic in high-demand applications and Danijela Vrzan demonstrated how to add dynamic links to iOS apps. Vincent Pradeilles led an interactive quiz session to engage the audience, and Antoine van der Lee shared tips and tricks to get the most out of the Swift language.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/paul.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/paul.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/paul.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/paul.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/paul.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/Danijela.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/Danijela.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/Danijela.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/Danijela.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/Danijela.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>Tim Oliver led an awesome discussion on the importance of sharing knowledge as content creators and Masahiko Funaki showed the importance of using CI/CD for iOS Development. Anya Traille brought some ideas on how to match colors, gradients, and images to our apps, and Donny Wals further explained the depth of Swift concurrency. Before the end of the conference, Priyal Porwal showed how to integrate brand-new Live activities into iOS 16-ready apps. Lastly, Adam Bell discussed some common mistakes and ways to avoid them to improve app responsiveness.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/panel.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/panel.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/panel.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/panel.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/panel.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/anya.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/anya.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/anya.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/anya.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/anya.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/priya.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/priya.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/priya.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/priya.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/priya.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/bell.jpg" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="2000" height="1125" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/bell.jpg 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/bell.jpg 1000w, https://iosdeveloperlife.com/content/images/size/w1600/2023/01/bell.jpg 1600w, https://iosdeveloperlife.com/content/images/size/w2400/2023/01/bell.jpg 2400w" sizes="(min-width: 720px) 720px"></figure><p>In addition to the technical sessions, the conference also provided an opportunity to network and make new friends at the after-party. It was a great way to unwind after a long day of learning and discussing the latest in iOS development.</p><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/IMG_1197.JPG" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="1512" height="850" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/IMG_1197.JPG 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/IMG_1197.JPG 1000w, https://iosdeveloperlife.com/content/images/2023/01/IMG_1197.JPG 1512w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card"><img src="https://iosdeveloperlife.com/content/images/2023/01/IMG_1198.JPG" class="kg-image" alt="Exploring Singapore and the Latest in iOS Development: My Tour of iOSConfSG 2023" loading="lazy" width="1286" height="723" srcset="https://iosdeveloperlife.com/content/images/size/w600/2023/01/IMG_1198.JPG 600w, https://iosdeveloperlife.com/content/images/size/w1000/2023/01/IMG_1198.JPG 1000w, https://iosdeveloperlife.com/content/images/2023/01/IMG_1198.JPG 1286w" sizes="(min-width: 720px) 720px"></figure><p>Overall, my experience at the iOSConfSG conference was incredibly valuable. I was able to learn from some of the best minds in the industry and stay up-to-date on the latest trends and technologies in iOS development. I would highly recommend this conference to any iOS developer looking to enhance their skills and knowledge.&quot;</p>]]></content:encoded></item></channel></rss>