infoMore than 3 years have passed since last update.
iOSアプリのエントリーポイントを調べる手順書
Last updated at Posted at 2017-07-28
前提
- Xcode 8.2.1で確認した
- 探す対象
-
UIApplicationDelegate
を実装した使用するクラス
- 最初に使用する
UIViewController
系クラス
本題
UIApplicationDelegate
を実装した使用するクラスを探す
Objective-Cの場合
-
main.m
を探す
-
UIApplicationMain()
の引数になっているクラスを調べる
- Xcodeでプロジェクト作成直後の場合
UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]))
-
AppDelegate
がApplicationDelegateとして使用される
Swiftの場合
main.swift
がない
- プロジェクト全体に対して
@UIApplicationMain
の検索をかける
- プロジェクト全体に対して
@main
の検索をかける
- Deployment Target iOS 14 以降の場合
main.swift
がある
-
main.swift
を開く
-
UIApplicationMain()
の引数になっているクラスを調べる
- 例えば
UIApplicationMain(Process.argc, Process.unsafeArgv, nil, NSStringFromClass(AppDelegate))
-
AppDelegate
がApplicationDelegateとして使用される
最初に使用するUIViewController
系クラスを探す
1. Projectを開き、Targetを調べたいアプリに指定する
2. Build SettingsからPackaging -> Info.plist File
の項目を確認する
- Xcodeでプロジェクト作成直後の場合
3. Info.plistを開きMain storyboard file base name
の項目を確認する
- Xcodeでプロジェクト作成直後の場合
- ちなみにInfo.plistを開き
Launch screen interface file base name
の項目を見ると、Launch時に使用するファイルの名前が確認できる。
4. 起動時に使用されるStoryboardを開き、Initial View Controllerを探す
- Xcodeでプロジェクト作成直後の場合
5. Initial View ControllerのCustom Classを見る
- Xcodeでプロジェクト作成直後の場合
14Go to list of users who liked
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up