Add pod 'NibDesignable'
to your Podfile
Add github "mbogh/NibDesignable"
to your Cartfile
.
Simply drop NibDesignable.swift
into your project and it is ready to use.
Create a new class that subclass' NibDesignable
like
class CustomView: NibDesignable {
}
Create a nib, place a UIView
and change the File's Owner
to CustomView
Correct:
Incorrect:
@IBInspectable
properties.Sometimes Xcode/Interface Builder does not recognize NibDesignable
as @IBDesignable
. Workaround Declare your custom class as @IBDesignable
like:
@IBDesignable
class CustomView: NibDesignable {
}
Follow me on Twitter (@mbogh) and/or visit my blog Just a Beech
Nib Designable is released under an MIT license. See LICENSE for more information.
Version 3.0.0
Version 2.3.0
UICollectionReusableView
support added by @ikesyoVersion 2.2.0
UICollectionViewCell
support added by @pyankoffVersion 2.1.0
UIControl
support added by @illazVersion 2.0.0
Version 1.1.1
UITableViewCell
Version 1.1.0
UITableViewCell
s, thanks to @duemunkVersion 1.0.4
Version 1.0.3
setupNib()
. This fixes issues when views have size of {0,0}
initially.Version 1.0.2
Version 1.0.1
nibName()
returns class name per default.Version 1.0.0