Skip to content

Elegant way of enabling IBDesignable on your nib-based views

License

Notifications You must be signed in to change notification settings

pyankoff/NibDesignable

 
 

Repository files navigation

Build Status

Nib Designable

Installation

CocoaPods

  1. Add pod 'NibDesignable' to your Podfile
  2. Add import NibDesignable
  3. Sometimes Xcode/Interface Builder does not recognize NibDesignable as @IBDesignable. Workaround Declare your custom class as @IBDesignable like:
@IBDesignable
class CustomView: NibDesignable {

}

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 {

}
  1. Create a nib, place a UIView and change the File's Owner to CustomView
  2. Design your view and add @IBInspectable properties.

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 2.1.0

  • UIControl support added by @illaz

Version 2.0.0

  • Swift 2.0 for everyone, thanks to @bjarkehs

Version 1.1.1

  • Fixed minor issue with UITableViewCell

Version 1.1.0

  • Added support for UITableViewCells, thanks to @duemunk

Version 1.0.4

  • Swift 1.2 support, thanks to @ikesyo

Version 1.0.3

  • Switched to Auto Layout in setupNib(). This fixes issues when views have size of {0,0} initially.

Version 1.0.2

  • CocoaPods support

Version 1.0.1

  • proxyView is passe.
  • nibName() returns class name per default.

Version 1.0.0

  • Initial release

About

Elegant way of enabling IBDesignable on your nib-based views

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 96.2%
  • Ruby 3.8%