我是iOS开发的新手。我正在使用Swift并且希望以编程方式设计我的视图,但我想使用IBDesigner和IBInspectable来加快我的设计过程。
现在,我有一个带有各种按钮和标签的视图控制器。这是我的代码片段:
@IBDesignable class LandingView: UIViewController, LandingViewProtocol {
@IBInspectable lazy var backButton: UIButton = {
var button = UIButton()
button.backgroundColor = Styles.BUTTON_COLOR
return button
}()
@IBInspectable lazy var caption: UILabel = UILabel()
}
我的问题是如何在IBDesignable和IBInspectable中使用界面构建器?我需要添加.xib文件吗?我看到其他一些问题提到我需要使用playground,但我尽量避免使用它,我实际上想知道是否可以查看整个视图控制器。
谢谢。