Member-only story
Getting Started with Deep Linking in UIKit 🧭
Deep linking is a powerful way to route users to specific parts of your iOS app, whether from another app or from the web. In this quick tutorial, we’ll go through setting up deep linking in a UIKit-based project with minimal boilerplate, making it easy to test and integrate into your app.
Create a new UIKit project
Start by creating a fresh UIKit project in Xcode:
Open Xcode and choose “App” under iOS.
Name your project (e.g. DeepLinksProject), make sure to select Storyboard for interface and UIKit App Delegate for lifecycle.
Handle the Deep Link in the SceneDelegate
Open the SceneDelegate.swift file and add the following method.
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
guard let url = URLContexts.first?.url else { return }
print("SceneDelegate received deeplink URL: \(url)")
// Handle auth callback here
}This method will be called when your app is opened via a registered custom URL scheme.
Add Your Custom URL Scheme
You need to register the URL scheme in the app.
