|
Hey everyone! I've got this itching with the 'init(destination:isActive:label:)' was deprecated in iOS 16.0. Which is the most appropriate way to fix this:
Thanks! |
|
@nixon has an itch
Repackage your destination's dataApple's direction for navigation seems direct enough. First consider providing a Then you provide a
Keep codingIs this a watch application you're developing? |
|
|
|
|
|
You are getting the warning because you are using NavigationView in your code. In iOS 16 Apple revamped SwiftUI navigation by creating NavigationStack and NavigationSplitView. The navigation revamp deprecated NavigationView. To get rid of the warning, you must replace NavigationView in your code with either NavigationStack or NavigationSplitView. But if you make this change, your app won't work on iOS 15 and below. If you need your code to run on earlier iOS versions, stick with NavigationView and ignore the warning. |
|
@Obelix, Thanks, I did it. @SwiftDevJournal, I tried to find examples for that kind of change, but they were too basic. Nothing with an image gallery like I need. |
|
What happens if you replace NavigationView with NavigationStack and keep the rest of the code? Apple provides a guide for converting NavigationView code to NavigationStack or NavigationSplitView. https://developer.apple.com/documentation/swiftui/migrating-to-new-navigation-types |
|
I fixed it, but it was quite a challenge and still don't know what's happening behind those lines :) |
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.