Sunday, May 19, 2024
HomeiOS Developmentios - Navigating to view with Common Hyperlink?

ios – Navigating to view with Common Hyperlink?


Right here is how I am at the moment dealing with Common Hyperlinks:

@principal
struct MyApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    
    @StateObject var dataManager = DataManager()

    var physique: some Scene {
        WindowGroup {
            MainView()
                .environmentObject(dataManager)
                .onOpenURL { url in
                    handleIncomingURL(url: url)
                }
        }
    }
    
    personal func handleIncomingURL(url: URL) {
        print(url)
        
        let parts = url.pathComponents
        let path = parts[1]
        
        if (path == "share") {
            // How do I navigate to my ProfileView() right here?
        }
    }
}

How can I navigate to my ProfileView() within the code above? Usually I’d simply do one thing like:

NavigationLink(vacation spot: ProfileView()) {

However I can not actually try this right here?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments