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
370
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
26
R.swift to Asset Symbols
417_72ki
0
260
Refactor with using `available` and `deprecated`
417_72ki
3
610
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
400
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
900
Trap Questions in Java and Obj-C
417_72ki
1
280
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.5k
Mockable UserDefaults with Duck typing
417_72ki
0
860
Other Decks in Technology
See All in Technology
AIのコンプラは何故しんどい?
shujisado
1
190
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
320
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
なぜCodeceptJSを選んだか
goataka
0
160
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
podman_update_2024-12
orimanabu
1
260
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
120
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
MLOps の現場から
asei
6
630
CustomCopを使ってMongoidのコーディングルールを整えてみた
jinoketani
0
220
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Six Lessons from altMBA
skipperchong
27
3.5k
How STYLIGHT went responsive
nonsquared
95
5.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Thoughts on Productivity
jonyablonski
67
4.4k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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