You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there anyway to avoid a massive execute function? The more deeplinks you have the more you will need to flesh out deepLinksTypes and more cases for the switch statement.
Is there not a way we can handle this more generically?
private func executeDeepLink(with url: URL) -> Bool {
// Create a recognizer with this app's custom deep link types.
let recognizer = DeepLinkRecognizer(deepLinkTypes: [
SelectTabDeepLink.self,
ShowPhotoDeepLink.self])
// Try to create a deep link object based on the URL.
guard let deepLink = recognizer.deepLink(matching: url) else {
print("Unable to match URL: \(url.absoluteString)")
return false
}
// Navigate to the view or content specified by the deep link.
switch deepLink {
case let link as SelectTabDeepLink: return selectTab(with: link)
case let link as ShowPhotoDeepLink: return showPhoto(with: link)
default: fatalError("Unsupported DeepLink: \(type(of: deepLink))")
}
}
The text was updated successfully, but these errors were encountered:
Is there anyway to avoid a massive execute function? The more deeplinks you have the more you will need to flesh out deepLinksTypes and more cases for the switch statement.
Is there not a way we can handle this more generically?
The text was updated successfully, but these errors were encountered: