Component - Deep linking
This UI component demonstrates how an iOS app handles deep linking. Deep linking lets users open the app directly to a specific screen or content by tapping a special link, like opening a message or product page right away.
This UI component demonstrates how an iOS app handles deep linking. Deep linking lets users open the app directly to a specific screen or content by tapping a special link, like opening a message or product page right away.
AppDelegate
└── UIWindow
└── UINavigationController
└── UIViewController (Home Screen)
└── UILabel (Welcome Text)
└── UIButton (Open Deep Link)myapp://profile?id=123?
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if url.scheme == "myapp" && url.host == "profile" {
print("Open profile with id: \(url.query ?? "none")")
return true
}
return false
}func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
if url.scheme = "myapp" {
// handle URL
return true
}
return false
}Pass the test and this pattern moves unknown