SlideShare a Scribd company logo
For Developing URL Routing of SwiftUI App
freddi - LINE Fukuoka
at potatotips (27th April,2020)
Goal of This Presentation
- SwiftUI(SceneDelegate) URL Routing
- URL Routing
- iOS12
URL Routing
- URL
https://snews.app/alerm
snews://alerm
URL Routing
-
- SceneDelegate URL ( )
- Routing
-
Parse URL in AppDelegate (Old way)
- AppDelegate application(_:, open:, options:)
- URL
// application(_:, open:, options:) -> Bool
func application(_ app: UIApplication, open url: URL, ...) -> Bool {
// Write down URL Parsing Procedure ...
return true
}
Parse URL in SceneDelegate
// scene(_:, openURLContexts:)
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
// Write down URL Parsing Procedure ...
}
New
- SceneDelegate scene(_:, openURLContexts:)
- AppDelegate Deprecated
※ SceneDelegate
URL Routing
-
- SceneDelegate URL
- Routing
-
Route to Goal Screen from Current Screen
- UIApplication.keyWindow Deprecated
Route to Goal Screen from Current Screen
- SceneDelegate.window
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
…
New
Route to Goal Screen from Current Screen
- UIWindow SwiftUI View
- … ViewController ?
Route to Goal Screen from Current Screen
- UIWindow SwiftUI View
- … ViewController ?
SwiftUI .sheet ViewController present
Route to Goal Screen from Current Screen
- UIWindow SwiftUI View
- … ViewController ?
UIWindow
UIHostingController(VC)
SwiftUI .sheet ViewController presentSwiftUI
Route to Goal Screen from Current Screen
- UIWindow SwiftUI View
- … ViewController ?
UIWindow
SwiftUI .sheet ViewController present
.sheet
.presentUIHostingController(VC)
SwiftUI
UIHostingController(VC)
SwiftUI
Route to Goal Screen from Current Screen
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
let url = URLContexts.first?.url
let distinationView = parseURLToDistination(url: url)
var currentTopVC = window?.rootViewController
while true {
if let presentedVC = currentTopVC?.presentedViewController {
currentTopVC = presentedVC
} else {
break
}
}
currentTopVC?.present(UIHostingController(rootView: distinationView), …
}
Route to Goal Screen from Current Screen
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
let url = URLContexts.first?.url
let distinationView = parseURLToDistination(url: url)
var currentTopVC = window?.rootViewController
while true {
if let presentedVC = currentTopVC?.presentedViewController {
currentTopVC = presentedVC
} else {
break
}
}
currentTopVC?.present(UIHostingController(rootView: distinationView), …
}
url
url View
VC
UIHostingController View
VC
URL Routing
-
- SceneDelegate URL
- Routing
-
Other Tips
- Navigation Coordinator
- sheet NavigationLink tag
- Navigation View push
- pushViewController
- Navigation UINavigationController
- NavigatorInsertionView( )
NavigatorInsertionView
struct NavigatorInsertionView: View {
static var contentView: AnyView? = nil
var body: some View { NavigatorInsertionView.contentView ??
{ () -> AnyView in
assertionFailure("Could not get AnyView")
return AnyView(EmptyView())
}()
}
}
NavigatorInsertionView
struct NavigatorInsertionView: View
NavigationLink("", destination: NavigatiorInsertionView(),
tag: Coordinator.MovingState.on,
selection: movingState)
.frame(width: 0, height: 0, alignment: .bottom)
Conclusion of URL Routing of SwiftUI App
- iOS13
- Coodinator
- SceneDelegate scene(_ scene:, openURLContexts:)
- Navigation VC present
https://hakata-swift.connpass.com/event/168308/

More Related Content

What's hot

Desenvolvendo APIs em Go usando Middlewares
Desenvolvendo APIs em Go usando MiddlewaresDesenvolvendo APIs em Go usando Middlewares
Desenvolvendo APIs em Go usando Middlewares
Elton Minetto
 
Add loop shortcode
Add loop shortcodeAdd loop shortcode
Add loop shortcode
Peter Baylies
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
Sumy PHP User Grpoup
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
Tudor Constantin
 
23.simple login with sessions in laravel 5
23.simple login with sessions in laravel 523.simple login with sessions in laravel 5
23.simple login with sessions in laravel 5
Razvan Raducanu, PhD
 
Git avançado
Git avançadoGit avançado
Git avançado
Jean Carlo Machado
 
Functional php
Functional phpFunctional php
Functional php
Jean Carlo Machado
 
PHP pod mikroskopom
PHP pod mikroskopomPHP pod mikroskopom
PHP pod mikroskopom
Saša Stamenković
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring Roo
Yasuharu Nakano
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2
Sumy PHP User Grpoup
 
21.search in laravel
21.search in laravel21.search in laravel
21.search in laravel
Razvan Raducanu, PhD
 
Feeds drupal cafe
Feeds drupal cafeFeeds drupal cafe
Feeds drupal cafe
Andrii Podanenko
 
Mojolicious
MojoliciousMojolicious
Mojolicious
Marcos Rebelo
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
Dirk Haun
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
WebF
 
Hidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeysHidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeys
Nicholas Dionysopoulos
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
bpmedley
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
Michelangelo van Dam
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.
Josh Hillier
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
Anatoly Sharifulin
 

What's hot (20)

Desenvolvendo APIs em Go usando Middlewares
Desenvolvendo APIs em Go usando MiddlewaresDesenvolvendo APIs em Go usando Middlewares
Desenvolvendo APIs em Go usando Middlewares
 
Add loop shortcode
Add loop shortcodeAdd loop shortcode
Add loop shortcode
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
23.simple login with sessions in laravel 5
23.simple login with sessions in laravel 523.simple login with sessions in laravel 5
23.simple login with sessions in laravel 5
 
Git avançado
Git avançadoGit avançado
Git avançado
 
Functional php
Functional phpFunctional php
Functional php
 
PHP pod mikroskopom
PHP pod mikroskopomPHP pod mikroskopom
PHP pod mikroskopom
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring Roo
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2
 
21.search in laravel
21.search in laravel21.search in laravel
21.search in laravel
 
Feeds drupal cafe
Feeds drupal cafeFeeds drupal cafe
Feeds drupal cafe
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
Hidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeysHidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeys
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 

Similar to For Developing URL Routing of SwiftUI App

Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Love at first Vue
Love at first VueLove at first Vue
Love at first Vue
Dalibor Gogic
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
NAVER Engineering
 
Mobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast diveMobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast dive
epamspb
 
React Native: JS MVC Meetup #15
React Native: JS MVC Meetup #15React Native: JS MVC Meetup #15
React Native: JS MVC Meetup #15
Rob Gietema
 
How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
Takuya Tejima
 
Swift LA Meetup at eHarmony- What's New in Swift 2.0
Swift LA Meetup at eHarmony- What's New in Swift 2.0Swift LA Meetup at eHarmony- What's New in Swift 2.0
Swift LA Meetup at eHarmony- What's New in Swift 2.0
Claire Townend Gee
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
Nic Raboy
 
Exemplo de Fluxograma de Arquitetura aplicativo
Exemplo de Fluxograma de Arquitetura aplicativoExemplo de Fluxograma de Arquitetura aplicativo
Exemplo de Fluxograma de Arquitetura aplicativo
Michel Anderson Lütz Teixeira
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
Antonio Peric-Mazar
 
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Mobivery
 
ASP.NET MVC Internals
ASP.NET MVC InternalsASP.NET MVC Internals
ASP.NET MVC Internals
Vitaly Baum
 
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ - Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Yuji Hato
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
Eric Guo
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Codemotion
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Luciano Mammino
 
Juzu framework
Juzu frameworkJuzu framework
Juzu framework
Kien Nguyen
 
Jsf intro
Jsf introJsf intro
Jsf intro
vantinhkhuc
 
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinAsync code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Fabio Collini
 
State manager in Vue.js, from zero to Vuex
State manager in Vue.js, from zero to VuexState manager in Vue.js, from zero to Vuex
State manager in Vue.js, from zero to Vuex
Commit University
 

Similar to For Developing URL Routing of SwiftUI App (20)

Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Love at first Vue
Love at first VueLove at first Vue
Love at first Vue
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
 
Mobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast diveMobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast dive
 
React Native: JS MVC Meetup #15
React Native: JS MVC Meetup #15React Native: JS MVC Meetup #15
React Native: JS MVC Meetup #15
 
How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
 
Swift LA Meetup at eHarmony- What's New in Swift 2.0
Swift LA Meetup at eHarmony- What's New in Swift 2.0Swift LA Meetup at eHarmony- What's New in Swift 2.0
Swift LA Meetup at eHarmony- What's New in Swift 2.0
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
 
Exemplo de Fluxograma de Arquitetura aplicativo
Exemplo de Fluxograma de Arquitetura aplicativoExemplo de Fluxograma de Arquitetura aplicativo
Exemplo de Fluxograma de Arquitetura aplicativo
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
 
ASP.NET MVC Internals
ASP.NET MVC InternalsASP.NET MVC Internals
ASP.NET MVC Internals
 
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ - Adaptive UI  - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
Adaptive UI - 解像度の異なるデバイスや画面の向きに対応する 最適なレイアウトへ -
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
 
Juzu framework
Juzu frameworkJuzu framework
Juzu framework
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinAsync code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
 
State manager in Vue.js, from zero to Vuex
State manager in Vue.js, from zero to VuexState manager in Vue.js, from zero to Vuex
State manager in Vue.js, from zero to Vuex
 

More from 秋 勇紀

Tutorial for developing SILOptimizer Pass
Tutorial for developing SILOptimizer PassTutorial for developing SILOptimizer Pass
Tutorial for developing SILOptimizer Pass
秋 勇紀
 
A Deeper Deep Dive into Swift Literal
A Deeper Deep Dive into Swift LiteralA Deeper Deep Dive into Swift Literal
A Deeper Deep Dive into Swift Literal
秋 勇紀
 
What Swifty is, from Enum
What Swifty is, from EnumWhat Swifty is, from Enum
What Swifty is, from Enum
秋 勇紀
 
Deep Dive into Swift Literal
Deep Dive into Swift LiteralDeep Dive into Swift Literal
Deep Dive into Swift Literal
秋 勇紀
 
SILOptimizerのCode Reading入門
SILOptimizerのCode Reading入門SILOptimizerのCode Reading入門
SILOptimizerのCode Reading入門
秋 勇紀
 
自作コンパイラのお話
自作コンパイラのお話自作コンパイラのお話
自作コンパイラのお話
秋 勇紀
 
ディープラーニングでポプテピピック
ディープラーニングでポプテピピックディープラーニングでポプテピピック
ディープラーニングでポプテピピック
秋 勇紀
 

More from 秋 勇紀 (7)

Tutorial for developing SILOptimizer Pass
Tutorial for developing SILOptimizer PassTutorial for developing SILOptimizer Pass
Tutorial for developing SILOptimizer Pass
 
A Deeper Deep Dive into Swift Literal
A Deeper Deep Dive into Swift LiteralA Deeper Deep Dive into Swift Literal
A Deeper Deep Dive into Swift Literal
 
What Swifty is, from Enum
What Swifty is, from EnumWhat Swifty is, from Enum
What Swifty is, from Enum
 
Deep Dive into Swift Literal
Deep Dive into Swift LiteralDeep Dive into Swift Literal
Deep Dive into Swift Literal
 
SILOptimizerのCode Reading入門
SILOptimizerのCode Reading入門SILOptimizerのCode Reading入門
SILOptimizerのCode Reading入門
 
自作コンパイラのお話
自作コンパイラのお話自作コンパイラのお話
自作コンパイラのお話
 
ディープラーニングでポプテピピック
ディープラーニングでポプテピピックディープラーニングでポプテピピック
ディープラーニングでポプテピピック
 

Recently uploaded

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
bjmsejournal
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Introduction to verilog basic modeling .ppt
Introduction to verilog basic modeling   .pptIntroduction to verilog basic modeling   .ppt
Introduction to verilog basic modeling .ppt
AmitKumar730022
 
5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf
devtomar25
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Operational amplifiers and oscillators notes
Operational amplifiers and oscillators notesOperational amplifiers and oscillators notes
Operational amplifiers and oscillators notes
ShachiPGowda
 

Recently uploaded (20)

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Introduction to verilog basic modeling .ppt
Introduction to verilog basic modeling   .pptIntroduction to verilog basic modeling   .ppt
Introduction to verilog basic modeling .ppt
 
5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Operational amplifiers and oscillators notes
Operational amplifiers and oscillators notesOperational amplifiers and oscillators notes
Operational amplifiers and oscillators notes
 

For Developing URL Routing of SwiftUI App

  • 1. For Developing URL Routing of SwiftUI App freddi - LINE Fukuoka at potatotips (27th April,2020)
  • 2. Goal of This Presentation - SwiftUI(SceneDelegate) URL Routing - URL Routing - iOS12
  • 4. URL Routing - - SceneDelegate URL ( ) - Routing -
  • 5. Parse URL in AppDelegate (Old way) - AppDelegate application(_:, open:, options:) - URL // application(_:, open:, options:) -> Bool func application(_ app: UIApplication, open url: URL, ...) -> Bool { // Write down URL Parsing Procedure ... return true }
  • 6. Parse URL in SceneDelegate // scene(_:, openURLContexts:) func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { // Write down URL Parsing Procedure ... } New - SceneDelegate scene(_:, openURLContexts:) - AppDelegate Deprecated ※ SceneDelegate
  • 8. Route to Goal Screen from Current Screen - UIApplication.keyWindow Deprecated
  • 9. Route to Goal Screen from Current Screen - SceneDelegate.window import UIKit import SwiftUI class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? … New
  • 10. Route to Goal Screen from Current Screen - UIWindow SwiftUI View - … ViewController ?
  • 11. Route to Goal Screen from Current Screen - UIWindow SwiftUI View - … ViewController ? SwiftUI .sheet ViewController present
  • 12. Route to Goal Screen from Current Screen - UIWindow SwiftUI View - … ViewController ? UIWindow UIHostingController(VC) SwiftUI .sheet ViewController presentSwiftUI
  • 13. Route to Goal Screen from Current Screen - UIWindow SwiftUI View - … ViewController ? UIWindow SwiftUI .sheet ViewController present .sheet .presentUIHostingController(VC) SwiftUI UIHostingController(VC) SwiftUI
  • 14. Route to Goal Screen from Current Screen func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { let url = URLContexts.first?.url let distinationView = parseURLToDistination(url: url) var currentTopVC = window?.rootViewController while true { if let presentedVC = currentTopVC?.presentedViewController { currentTopVC = presentedVC } else { break } } currentTopVC?.present(UIHostingController(rootView: distinationView), … }
  • 15. Route to Goal Screen from Current Screen func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { let url = URLContexts.first?.url let distinationView = parseURLToDistination(url: url) var currentTopVC = window?.rootViewController while true { if let presentedVC = currentTopVC?.presentedViewController { currentTopVC = presentedVC } else { break } } currentTopVC?.present(UIHostingController(rootView: distinationView), … } url url View VC UIHostingController View VC
  • 16. URL Routing - - SceneDelegate URL - Routing -
  • 17. Other Tips - Navigation Coordinator - sheet NavigationLink tag - Navigation View push - pushViewController - Navigation UINavigationController - NavigatorInsertionView( )
  • 18. NavigatorInsertionView struct NavigatorInsertionView: View { static var contentView: AnyView? = nil var body: some View { NavigatorInsertionView.contentView ?? { () -> AnyView in assertionFailure("Could not get AnyView") return AnyView(EmptyView()) }() } }
  • 19. NavigatorInsertionView struct NavigatorInsertionView: View NavigationLink("", destination: NavigatiorInsertionView(), tag: Coordinator.MovingState.on, selection: movingState) .frame(width: 0, height: 0, alignment: .bottom)
  • 20. Conclusion of URL Routing of SwiftUI App - iOS13 - Coodinator - SceneDelegate scene(_ scene:, openURLContexts:) - Navigation VC present
  • 21.