Hi! this is TDCIAN!
Today, let's find out how to use deep link in SwiftUI!
First, if your Xcode version is bigger than 13.0 or equal, then you should go to 'Info' file and
add 'URL Types' under 'Information Property List', and finally add 'URL Schemes' that you want to use.
In my case, I used "hi-hello" for URL of my application.
and if your Xcode version is smaller than 13.0, then you should go to project file andclick 'info' tab, and then click 'URL Types'
and just like this picture, add your own URL Schemes, in this video, the teacher used 'deeplink-swiftui'.
(1) TodosView
To make 'Todo' list, check this code. You can find 'TodosView.swift' file in my full source code.
(2) ProfileView
To make 'Profile' view, check this code. You can find 'ProfileView.swift' file in my full source code.
(3) TabView
Finally, to make tab view contains todo list and profie view, check this code. You can find 'SwiftUIDeepLinkApp.swift' file in my full source code.
* Use in Simulator
(1) Build app
(2) Open Safari
(3) Type your own scheme
(4) Open your app with Safari
(5) App is opened with 'Profile' tab, not 'Todo' tab.
Full source code: https://github.com/TDCIAN/SwiftUIDeepLink
Reference: https://www.youtube.com/watch?v=kjDl_15fOEQ
'iOS > SwiftUI' 카테고리의 다른 글
[iOS / SwiftUI] Bottom Sheet Drawer Use with Gesture (0) | 2022.01.07 |
---|---|
[iOS / SwiftUI] Check Network Connection Status with NWPathMonitor (0) | 2021.12.30 |