项目作者: FinderTiwk

项目描述 :
在interface builder中快速设置一些Xcode没有提供的custom runtime attributes的UI分类
高级语言: Objective-C
项目地址: git://github.com/FinderTiwk/InterfaceBuilderKit.git
创建时间: 2016-08-01T14:48:50Z
项目社区:https://github.com/FinderTiwk/InterfaceBuilderKit

开源协议:

下载


InterfaceBuilderKit

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

Version
License
Platform
Author

0x00 UIView(Categroy)


0x01 原理

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

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

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