Xcode xib module的作用 - 找不到xib的一種情況

如果不小心選擇了這個,則找不到xib,使應用崩潰。

在這裏插入圖片描述

作用:

  • 1 當需要使用的自定義類嵌入在.framework文件中的時,在xib中,需要選擇該自定義類的位置

    • 比如您已經添加了一個cocoapod庫,它爲您提供了一個自定義的UIView子類,並且您希望將其添加到您的故事板中,因此,您必須將該庫“導入”到IB,然後選擇自定義視圖
  • 2 可以視爲設置IB的“導入庫”

參考

what is the purpose of module in IOS interface builder?
When you need to use a custom class that its source file is embedded in .framework file for example.
let’s say you’ve added a cocoapod library that gives you a custom UIView subclass and you want to add it inside your storyboard. So you will have to “import” that library to IB and then select the custom view.
You can think of it as the “import Library” line for the IB.

當需要使用的自定義類嵌入在.framework文件中的時,比如您已經添加了一個cocoapod庫,它爲您提供了一個自定義的UIView子類,並且您希望將其添加到您的故事板中。因此,您必須將該庫“導入”到IB,然後選擇自定義視圖。
您可以將其視爲IB的“導入庫”行。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章