Skip to main content

iOS 15 Programming Fundamentals with Swiftの9章と10章を読んだので不明点をまとめる

iOS 15 Programming Fundamentals with Swiftの7章と8章を読んだので不明点をまとめる
の続編

II. IDEの
9. Documentation
10. Life Cycle of a Project
で不明点をまとめる

ドキュメント
・Developer Document
Cmd + Shift + 0
or
Windows -> Developer Documentation or Help
でドキュメントが読める
https://developer.apple.com/documentation

補足資料もあったりする
https://developer.apple.com/library/archive/navigation/

・Quick Help
メソッドを選択して
Cmd + option + 3
を押すとQuick Helpがでる
あるいはヘルプから呼べる

 

コード
・Debugで出しわけ
以下で出しわけできる
#if DEBUG
#else
#endif

・OSバージョンで出しわけ

if #available(iOS 10.0, *) {
} else {
}

・実行時にパラメーターを渡す
Arguments Passed On Launch
Environment Variables
https://qiita.com/kanari3/items/2d2792cc47d22d3172ad

・コードの差分確認
以下で差分が確認できる
View -> Show Code Review

以下でファイルの更新履歴が見れる
View->Inspector->History

以下で該当の行を誰が修正したかわかる
Editor->Author

・コードのindent
Cmd + Aして
Ctrl + i

・コード補完
ESCを押すとサジェストが出る

・snippet
Cmd + Shift + Lでsnippetが出る

・Refactoring
Editor->Refactor
でリファクタリングできる

 

シュミレーター
・ベゼルの選択
Window -> Show Device Bazels
でベゼルのありなしを選べる

・コマンドでの実行
xcrunにパラメーターを与えることで諸々できる
https://qiita.com/tamaki/items/02eb43253193b950b08f

 

デバック
・デバック時にパラメーターの中身を見る
tyloo
クラスの概要が出る
(lldb) ty loo -l objc — ViewController

v
ローカル変数が出る

p
https://grandbig.github.io/blog/2019/09/07/po-v-command/

 

ユニットテスト
・ユニットテストについての説明
XCTSkip
XCTSkipでスキップできる
https://qiita.com/ahiru___/items/e724b58253fe1ad3e0ce

XCTExpectFailure
When using XCTExpectFailure, you give yourself a checkpoint that informs you to re-enable a test. If our avatar color correctly returns blue again but we still have our expected failure configured, Xcode will inform us with a failing test:
https://www.avanderlee.com/swift/xctexpectfailure-expected-failures/

@testable
targetsを読み込む
https://qiita.com/motokiee/items/d9314b7e1e8f6cce7483

coverage
build schemeで設定する
そして、Build一覧から確認できる
https://qiita.com/takehilo/items/79da07128133a1798b1f

 

リリース
・証明書
private key
keychainの中にあるやつ

certicate
公開鍵

provisioning profile
以下が入ってる
idenity
bundle identifier
eligible devices
entitlement ex.iCloud

関連記事:

Pocket