To run the example project, clone the repo, and run pod install
from the Example directory first.
//1.引入库
import HaidoraNibDesignable
@IBDesignable
//2.实现HaidoraNibDesignable
class DesignableView: UIView,HaidoraNibDesignable {
override init(frame: CGRect) {
super.init(frame: frame)
//添加nib文件到当前view
self.setupNib()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
//添加nib文件到当前view
self.setupNib()
}
}
import HaidoraNibDesignable
//继承HaidoraNibDesignableView
class InputView: HaidoraNibDesignableView {
}
- xcode8+
- Swift3.0
- iOS8+
HaidoraNibDesignable is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "HaidoraNibDesignable"
mrdaios, mrdaios@gmail.com
HaidoraNibDesignable is available under the MIT license. See the LICENSE file for more info.