Skip to content

Haidora/HaidoraNibDesignable

Repository files navigation

HaidoraNibDesignable

CI Status Version License Platform

Example

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 {

}

Requirements

  • xcode8+
  • Swift3.0
  • iOS8+

Installation

HaidoraNibDesignable is available through CocoaPods. To install it, simply add the following line to your Podfile:

    pod "HaidoraNibDesignable"

Inspired by these projects:

Author

mrdaios, mrdaios@gmail.com

License

HaidoraNibDesignable is available under the MIT license. See the LICENSE file for more info.