Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The history of entry-point in iOS app Development

417.72KI
October 27, 2023

The history of entry-point in iOS app Development

417.72KI

October 27, 2023
Tweet

More Decks by 417.72KI

Other Decks in Technology

Transcript

  1. .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..." ]
  2. 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
  3. 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); }
  4. 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 } }
  5. J04ΞϓϦ։ൃʹ͓͚ΔΤϯτϦʔϙΠϯτ !6*"QQMJDBUJPO.BJO w NBJOTXJGUΛ҉໧తʹੜ੒͢Δ w 4XJGUͰඇਪ঑ɺ4XJGUͰഇࢭ༧ఆ UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self))

    IUUQTHJUIVCDPNBQQMFTXJGUCMPCGFCBEDFEDGDFBFFEE$)"/(&-0(NE QMBJO-- IUUQTHJUIVCDPNBQQMFTXJGUDPNNJUDDCDDGDBC
  6. 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 } }
  7. 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 } }
  8. 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 } }
  9. 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() }
  10. ςετͱΤϯτϦʔϙΠϯτ εϓϥογϡը໘ͰͷॲཧʹΑΔ෭࡞༻ ྫ w γϛϡϨʔλͰಈ࡞֬ೝ͢Δ ϩάΠϯͨ͠ঢ়ଶ  w ಉҰγϛϡϨʔλͰςετ࣮ߦ w

    γϛϡϨʔλͷ6TFS%FGBVMUTʹ࢒͍ͬͯͨτʔΫϯΛ)PTU"QQMJDBUJPO্ͷ TJOHMFUPOPCKFDU͕र্͍͛Δ w ςετର৅ͷதͰͦͷTJOHMFUPOΛݟΔॲཧ͕τʔΫϯΛ࢖ͬͯॲཧͯ͠͠·͏ w ૝ఆͱҟͳΔ࣮ߦ݁Ռ͕ग़ྗ͞Ε౰֘ςετ͕'BJMFEʹ😱
  11. ςετͱΤϯτϦʔϙΠϯτ ରࡦ 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 ϓϩμΫτίʔυ͕ԚΕΔ
  12. "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 } }
  13. "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 } ɾ ɾ ɾ
  14. "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 } ɾ ɾ ɾ
  15. 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() } } }