Xcode中的@IBDesignable和@IBInspectable关键字出来也有一段时间了,目的是当用户改变View属性时InterfaceBuilder的界面里可以得到即时刷新反馈.
这无疑对于App界面的调整带来很多方便.不过网上很多童鞋都会抱怨使用时会出现或多或少的问题,不要着急,就让本猫带领大家来看看到底该怎么使用这两个关键字. ;)
官方对这两个关键字(属性)是这么说的:
"Live Rendering
You can use two different attributes—@IBDesignable and @IBInspectable—to enable live, interactive custom view design in Interface Builder. When you create a custom view that inherits from the UIView class or the NSView class, you can add the @IBDesignable attribute just before the class declaration. After you add the custom view