mbogh / NibDesignable

Elegant way of enabling IBDesignable on your nib-based views
MIT License
342 stars 74 forks source link

Build Status Carthage compatible Pod version GitHub license

Nib Designable

Installation

CocoaPods

Add pod 'NibDesignable' to your Podfile

Carthage

Add github "mbogh/NibDesignable" to your Cartfile.

Manual

Simply drop NibDesignable.swift into your project and it is ready to use.

Usage

  1. Create a new class that subclass' NibDesignable like

    class CustomView: NibDesignable {
    
    }
  2. Create a nib, place a UIView and change the File's Owner to CustomView

    Correct:

    `File's Owner` is set to your custom class

    Incorrect:

    `View` class is set to your custom class

  3. Design your view and add @IBInspectable properties.
  4. Sometimes Xcode/Interface Builder does not recognize NibDesignable as @IBDesignable. Workaround Declare your custom class as @IBDesignable like:

    @IBDesignable
    class CustomView: NibDesignable {
    
    }

Thanks

Contact

Follow me on Twitter (@mbogh) and/or visit my blog Just a Beech

License

Nib Designable is released under an MIT license. See LICENSE for more information.

Release Notes

Version 3.0.0

Version 2.3.0

Version 2.2.0

Version 2.1.0

Version 2.0.0

Version 1.1.1

Version 1.1.0

Version 1.0.4

Version 1.0.3

Version 1.0.2

Version 1.0.1

Version 1.0.0