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
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
130
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
230
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
260
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.3k
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
100
なぜCodeceptJSを選んだか
goataka
0
160
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
110
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Code Reviewing Like a Champion
maltzj
520
39k
Site-Speed That Sticks
csswizardry
2
190
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The World Runs on Bad Software
bkeepers
PRO
65
11k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Become a Pro
speakerdeck
PRO
26
5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Scaling GitHub
holman
458
140k
Music & Morning Musume
bryan
46
6.2k
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