Xcode Creating Custom Controls in Interface Builder with @IBDesignable

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Remarks

It became much easier to create custom controls in Interface Builder with the introduction of the @IBDesignable and @IBInspectable directives in Swift. Developers can now build rich, complex, fully animated controls using just a few extra lines of code. I'm surprised by how many developers have yet to fully embrace this feature, and I frequently find that adding just a few of lines of code to existing classes can make them so much easier to work with.

Note that these features are also available in Objective-C and are a great way of breathing life into old classes. The syntactic equivalents in Objective-C are IB_DESIGNABLE and IBInspectable, but for now I'll be concentrating on examples in Swift.



Got any Xcode Question?