Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The history of entry-point in iOS app Development
Search
417.72KI
October 27, 2023
Technology
0
360
The history of entry-point in iOS app Development
https://testnight.connpass.com/event/295913
417.72KI
October 27, 2023
Tweet
Share
More Decks by 417.72KI
See All by 417.72KI
iTunes・おぼえていますか〜ScriptingBridge今昔物語〜
417_72ki
1
19
R.swift to Asset Symbols
417_72ki
0
240
Refactor with using `available` and `deprecated`
417_72ki
3
590
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
390
CI with Danger-Swift
417_72ki
1
190
Graduation from Playground beginner
417_72ki
3
890
Trap Questions in Java and Obj-C
417_72ki
1
270
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.4k
Mockable UserDefaults with Duck typing
417_72ki
0
820
Other Decks in Technology
See All in Technology
入門『状態』#kaigionrails / "state" for beginners with Rails
shinkufencer
2
810
Railway Oriented Programming を オニオンアーキテクチャに適用する by kotlin-result / Railway Oriented Programming in Onion Architecture by kotlin-result
yuitosato
2
210
新R25、乃木坂46 Mobileなどのファンビジネスを支えるマルチテナンシーなプラットフォームの全体像 / cam-multi-cloud
cyberagentdevelopers
PRO
1
110
CAMERA-Suite: 広告文生成のための評価スイート / ai-camera-suite
cyberagentdevelopers
PRO
3
230
サーバーサイドのデータプレーンプログラミング 〜 NVIDIA Blue Field / DOCA 〜
ebiken
PRO
1
230
Data Migration on Rails
ohbarye
7
4.5k
ガバメントクラウド単独利用方式におけるIaC活用
techniczna
3
180
Kubernetes Summit 2024 Keynote:104 在 GitOps 大規模實踐中的甜蜜與苦澀
yaosiang
0
270
クラシルの現在とこれから
am1157154
1
340
品質の高い機能を”早く”提供するために技術的な面でチームでやったこと、やりたいこと
sansantech
PRO
2
230
都市伝説バスターズ「WebアプリのボトルネックはDBだから言語の性能は関係ない」 - Kaigi on Rails 2024
osyoyu
13
4.8k
内製化によるシステムモダナイゼーションの実践
kazokmr
3
530
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
GitHub's CSS Performance
jonrohan
1030
460k
It's Worth the Effort
3n
183
27k
A Tale of Four Properties
chriscoyier
156
23k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Six Lessons from altMBA
skipperchong
26
3.4k
Designing the Hi-DPI Web
ddemaree
280
34k
What's new in Ruby 2.0
geeforr
342
31k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
Unsuck your backbone
ammeep
668
57k
Transcript
!@LJ J04։ൃʹ͓͚Δ ΤϯτϦʔϙΠϯτͷྺ࢙ J045FTU/JHIU
.FTXJGU let name = "Takuhiro Muta" let twitter = "417_72ki"
let github = "417-72KI" let company = "(redacted)" var products = [ "MockUserDefaults", "MultipartFormDataParser", "BuildConfig.swift", "R2ACConverter", "SSGH", ] var contributing = [ "Danger-Swift", "octokit.swift", "etc..." ]
͓ॻ͖ w ΤϯτϦʔϙΠϯτͱ w J04։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ w ςετͱΤϯτϦʔϙΠϯτ
ΤϯτϦʔϙΠϯτͱ
ΤϯτϦʔϙΠϯτͱ w ΞϓϦέʔγϣϯͷϓϩάϥϜΛ࣮ߦ͢Δࡍ࠷ॳʹݺͼग़͞ΕΔॲཧؔ ͷ͜ͱ w $JOUNBJO w +BWBQVCMJDTUBUJDWPJENBJO 4USJOHBSHT
w FUD
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ J04ΞϓϦ։ൃͱΤϯτϦʔϙΠϯτͷมભ ࣌ظ ओͳग़དྷࣄ ݴޠ 'SBNFXPSLT ΤϯτϦʔϙΠϯτ ʙ 0CKFDUJWF$ Ћ
6*,JU NBJON 88%$Ͱ4XJGUൃද 9DPEF4XJGUϦϦʔε 0CKFDUJWF$ Ћ 4XJGU Ћ 6*,JU NBJON "QQ%FMFHBUFTXJGU 88%$Ͱ4XJGU6*ൃද 9DPEF4XJGU6*ϦϦʔε 0CKFDUJWF$ Ћ 4XJGU 6*,JU 4XJGU6* NBJON "QQ%FMFHBUFTXJGU 4DFOF%FMFHBUF 4XJGU6*ϦϦʔε 0CKFDUJWF$ Ћ 4XJGU 6*,JU 4XJGU6* NBJON "QQ%FMFHBUFTXJGU 4DFOF%FMFHBUF "QQTXJGU
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 0CKFDUJWF$ w NBJON #import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int
argc, char * argv[]) { NSString * appDelegateClassName; @autoreleasepool { appDelegateClassName = NSStringFromClass([AppDelegate class]); } return UIApplicationMain(argc, argv, nil, appDelegateClassName); }
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGU w NBJOTXJGU UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self)) 🙅
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGUXJUI6*,JU w "QQ%FMFHBUFTXJGU @UIApplicationMain // deprecated and will be
error in Swift 6 final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize app return true } }
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ !6*"QQMJDBUJPO.BJO w NBJOTXJGUΛ҉తʹੜ͢Δ w 4XJGUͰඇਪɺ4XJGUͰഇࢭ༧ఆ UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self))
IUUQTHJUIVCDPNBQQMFTXJGUCMPCGFCBEDFEDGDFBFFEE$)"/(&-0(NE QMBJO-- IUUQTHJUIVCDPNBQQMFTXJGUDPNNJUDDCDDGDBC
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ ༨ஊɿ!6*"QQMJDBUJPO.BJOͷࠟ IUUQTHJUIVCDPNTFBSDI RSFQP"BQQMF'TXJGU 6*"QQMJDBUJPO.BJOUZQFDPEF
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGUXJUI6*,JU w "QQ%FMFHBUFTXJGU @UIApplicationMain // deprecated and will be
error in Swift 6 final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize app return true } }
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGU d XJUI6*,JU w "QQ%FMFHBUFTXJGU @main final class AppDelegate:
UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize app return true } }
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ !NBJO w 4XJGUʹ͓͚ΔΤϯτϦʔϙΠϯτΛࣔ͢BUUSJCVUF w 4XJGUͰՃ w !NBJO͕͍ͨDMBTTTUSVDUFOVNQVCMJDTUBUJDGVODNBJO ͷ࣮ ͕ඞਢ
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ !NBJO
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGU6*Y w "QQ%FMFHBUFTXJGU @UIApplicationMain // deprecated and will be
error in Swift 6 final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize SceneDelegate if needed return true } }
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGU6*Y w 4DFOF%FMFHBUFTXJGU final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } let window = UIWindow(windowScene: windowScene) window.rootViewController = UIHostingController(rootView: RootView()) self.window = window window.makeKeyAndVisible() }
J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ 4XJGU6*d w "QQTXJGU @main struct EntrypointSample_SwiftUIApp: App { var
body: some Scene { WindowGroup { ContentView() } } }
4XJGU6*d J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ
ςετͱΤϯτϦʔϙΠϯτ
ςετͱΤϯτϦʔϙΠϯτ J04ͷςετʹ͓͚Δ՝ w J04ͷςετ)PTU"QQMJDBUJPO্Ͱ࣮ߦ͞ΕΔ w )PTU"QQMJDBUJPO͕ىಈ͢Δ w ىಈ·Ͱͷ͕࣌ؒϘτϧωοΫʹͳΔ w ىಈ࣌ʹ௨৴6TFS%FGBVMUTͷॻ͖ࠐΈΛ͍ͯ͠ΔͱɺͦΕ͕ࢥ
Θ͵෭࡞༻ΛҾ͖ىͯ͜͠ςετʹӨڹ͢Δ߹͕͋Δ
ςετͱΤϯτϦʔϙΠϯτ ىಈ·Ͱͷ͕࣌ؒϘτϧωοΫʹͳΔ
ςετͱΤϯτϦʔϙΠϯτ εϓϥογϡը໘ͰͷॲཧʹΑΔ෭࡞༻ ྫ w γϛϡϨʔλͰಈ࡞֬ೝ͢Δ ϩάΠϯͨ͠ঢ়ଶ w ಉҰγϛϡϨʔλͰςετ࣮ߦ w
γϛϡϨʔλͷ6TFS%FGBVMUTʹ͍ͬͯͨτʔΫϯΛ)PTU"QQMJDBUJPO্ͷ TJOHMFUPOPCKFDU͕र্͍͛Δ w ςετରͷதͰͦͷTJOHMFUPOΛݟΔॲཧ͕τʔΫϯΛͬͯॲཧͯ͠͠·͏ w ఆͱҟͳΔ࣮ߦ݁Ռ͕ग़ྗ͞Ε֘ςετ͕'BJMFEʹ😱
ςετͱΤϯτϦʔϙΠϯτ ରࡦ w #FTU w ϓϩμΫτίʔυΛ4XJGU1BDLBHFʹ͢Δ w 1BDLBHFଆͰςετΛΒͤΔͱ)PTU"QQMJDBUJPOΛΘͳ͍ w YDGSBNFXPSLඇରԠϥΠϒϥϦ͕͋ͬͨΓ͢ΔͱෆՄ
w #FUUFS w "QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ w ىಈॲཧΛεΩοϓͰ͖Δ w /PU#BE w ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"]ͷ༗ແͰஅ͢Δ w ϓϩμΫτίʔυ͕ԚΕΔ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ w ςετλʔήοτʹ.PDL"QQ%FMFHBUFΛ༻ҙ͢Δ w "QQ%FMFHBUF͔Β@mainΛফ͢ w NBJOTXJGUΛ༻ҙ͢Δ w ςετ࣌.PDL"QQ%FMFHBUFΛݟΔΑ͏ʹࡉ͢Δ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ ςετλʔήοτʹ.PDL"QQ%FMFHBUFΛ༻ҙ͢Δ import UIKit @objc(MockAppDelegate) final class MockAppDelegate: UIResponder, UIApplicationDelegate
{ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { print("This is MockAppDelegate") return true } }
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ w ςετλʔήοτʹ.PDL"QQ%FMFHBUFΛ༻ҙ͢Δ w "QQ%FMFHBUF͔Β@mainΛফ͢ w NBJOTXJGUΛ༻ҙ͢Δ w ςετ࣌.PDL"QQ%FMFHBUFΛݟΔΑ͏ʹࡉ͢Δ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ "QQ%FMFHBUF͔Β!NBJOΛফ͢ @main final class AppDelegate: UIResponder, UIApplicationDelegate { func
application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { print("This is AppDelegate") return true } ɾ ɾ ɾ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ "QQ%FMFHBUF͔Β!NBJOΛফ͢ final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_
application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { print("This is AppDelegate") return true } ɾ ɾ ɾ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ w ςετλʔήοτʹ.PDL"QQ%FMFHBUFΛ༻ҙ͢Δ w "QQ%FMFHBUF͔Β@mainΛফ͢ w NBJOTXJGUΛ༻ҙ͢Δ w ςετ࣌.PDL"QQ%FMFHBUFΛݟΔΑ͏ʹࡉ͢Δ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ NBJOTXJGUΛ༻ҙͯ͠ςετ࣌.PDL"QQ%FMFHBUFΛݟΔΑ͏ʹࡉ͢Δ UIApplicationMain( CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self) )
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ NBJOTXJGUΛ༻ҙͯ͠ςετ࣌.PDL"QQ%FMFHBUFΛݟΔΑ͏ʹࡉ͢Δ let appDelegateClass: AnyClass = NSClassFromString("MockAppDelegate") ?? AppDelegate.self UIApplicationMain(
CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(appDelegateClass) )
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ
"QQ%FMFHBUFΛ࣮ߦ͠ͳ͍Α͏ʹ͢Δ #JUSJTF্Ͱͷςετ࣮ߦ࣌ؒൺֱ ͬ͘͟Γ w #FGPSF w ฏۉN w "GUFS w
ฏۉN
1VSF4XJGU6*"QQͷ߹ .PDL"QQΛ/40CKFDUʹ͢Δ @objc(MockApp) final class MockApp: NSObject, App { override
init() { super.init() print("This is MockApp.") } var body: some Scene { WindowGroup { EmptyView() } } }
1VSF4XJGU6*"QQͷ߹ BOZ"QQ5ZQFͰΩϟετ͢Δ͜ͱͰNBJO ͕ݺͼग़ͤΔ if let clazz = NSClassFromString("MockApp") as? any
App.Type { clazz.main() } else { EntrypointSample_SwiftUIApp.main() }
·ͱΊ
·ͱΊ w J04։ൃͷྺ࢙ͷதͰΤϯτϦʔϙΠϯτෳճมΘ͍ͬͯΔ w ΤϯτϦʔϙΠϯτͱࠇຐज़Λͬͯςετ࣌ͷ)PTU"QQMJDBUJPOͷىಈॲ ཧΛճආͰ͖Δ w ςετͷ࣮ߦ͕࣌ؒॖͰ͖Δ w αϯϓϧίʔυ
w IUUQTHJUIVCDPN,*&OUSZQPJOU4BNQMF
'JO