简体   繁体   English

IOS界面构建器中模块的用途是什么?

[英]what is the purpose of module in IOS interface builder?

I'm new to iOS, I found a textfield called Module in identity inspector of interface builder. 我是iOS的新手,我在界面构建器的身份检查器中找到了一个名为Module的文本域。 What is the use/purpose of this field? 这个领域的用途/目的是什么? I searched in web but didn't find satisfactory answer. 我在网上搜索但没有找到满意的答案。 Can any one please explain? 任何人都可以解释一下吗?

在此输入图像描述

When you need to use a custom class that its source file is embedded in .framework file for example. 当您需要使用自定义类时,其源文件嵌入在.framework文件中。

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. 假设你已经添加了一个cocoapod库,它为你提供了一个自定义的UIView子类,你想在故事板中添加它。 So you will have to "import" that library to IB and then select the custom view. 因此,您必须将该库“导入”到IB,然后选择自定义视图。

You can think of it as the "import Library" line for the IB. 您可以将其视为IB的“导入库”行。

I assume it's Module as defined by the Swift programming language and will define which module to load the class from: 我假定它是模块由所限定夫特编程语言 ,并且将定义哪些模块,用于从加载类:

A module is a single unit of code distribution—a framework or application that is built and shipped as a single unit and that can be imported by another module with Swift's import keyword. 模块是一个代码分发单元 - 一个框架或应用程序,它作为一个单元构建和发布,可以由另一个模块使用Swift的import关键字导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM