Slide 11
Slide 11 text
Before
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
let url = URL(string: "pokedex://pokemons/25")!
let components = url.pathComponents
if url.scheme == "pokedex" {
if url.host == "pokemons" {
if components.count == 2, let pokedexID: Int = Int(components[1]) {
presentPokemonDetailViewController(of: pokedexID)
return true
} else if ( ... ) {
} else {
// ...
}
}
}
}
}
11