LoginSignup
18
18

More than 5 years have passed since last update.

iOSでFramework を参照するときの RequiredとOptional.

Posted at

Frameworkのstatus

Xcode上でframeworkをimportするときに、下記のようにframeworkのstatusが出てくる。
よくわからなかったので調べました。

スクリーンショット 2015-02-16 17.20.58.png

Required / Optional

Document にきちんと載ってました。

原文:

Libraries and frameworks are designated as Required by default, but you can change this designation to Optional. Required libraries must be present on the host computer for the product to load. Optional libraries do not have to be present for the product to load. A Required framework will always be loaded into memory, but an Optional framework will be loaded only if needed. The initial load of the application will be faster if a large library that is never needed is designated as Optional.

日本語訳:

ライブラリとフレームワークはデフォルトでRequiredになるように選択されています、しかしOptionalに変更することも可能です。Required ライブラリは そのproductがロードされるときにマシン上に出現していなくてはなりません。Optional ライブラリは ロードされるときに出現している必要がありません。Required フレームワークは常にメモリ上にロードされるのに対して、Optional フレームワークは必要になった時だけロードされます。もしそれ以上は必要のない大きなライブラリがあってOptionalに選択されていれば、アプリケーションの初期ロードが早まります。

要はロードを早めるために利用頻度が少ないものはOptionalにしつつ、常時必要そうなものはRequiredにしましょうねってことだと理解してる。
もし全然違ってたら、ご指摘ください・・・

参考

18
18
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
18