Skip to content

Instantly share code, notes, and snippets.

@aronbalog
Last active July 26, 2019 19:25
Show Gist options
  • Save aronbalog/84b85a7cecab160f51b29a0153717e7b to your computer and use it in GitHub Desktop.
Save aronbalog/84b85a7cecab160f51b29a0153717e7b to your computer and use it in GitHub Desktop.
import Foundation
import CoreNavigation
extension NSUserActivity {
enum Error: Swift.Error {
case unprocessableEntity
}
func navigate() throws {
guard
activityType == NSUserActivityTypeBrowsingWeb,
let url = webpageURL
else {
throw Error.unprocessableEntity
}
Navigate.push { $0
.to(url)
.animated(false)
.onSuccess({ (result) in
let color = result.data as? UIColor
print("Did open deep link url: \(url), data: \(color!)")
})
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment