Skip to content

在interface builder中快速设置一些Xcode没有提供的custom runtime attributes的UI分类

Notifications You must be signed in to change notification settings

FinderTiwk/InterfaceBuilderKit

Repository files navigation

InterfaceBuilderKit

在interface builder中快速设置一些Xcode没有提供的custom runtime attributes的UI分类 使用Cocoapods时,请添加 use_frameworks!

Version License Platform Author

0x00 UIView(Categroy)

0x01 原理

一 . IBInspectable 通过在属性前添加IBInspectable关键字可以让此属性出现在Storyboard/Xib上的属性设置项中,当在设置项中设置时,其实是为视图控件添加用户自定义Runtime属性.

//eg:
@property (nonatomic,assign) IBInspectable CGFloat X_BorderWidth;

二. IB_DESIGNABLE 在类/分类前标记,可以使被标记的视图制件在Storyboard/Xib中实时渲染

About

在interface builder中快速设置一些Xcode没有提供的custom runtime attributes的UI分类

Resources

Stars

Watchers

Forks

Packages