Using IBDesignable and IBInspectable in Swift

See your stuff in the Storyboard

Image for post
Image for post
Photo by Molly Belle on Unsplash

Prerequisites:

Terminology

Motivation

A simple UIView subclass

Image for post
Image for post
Image for post
Image for post
Click for Gist
Image for post
Image for post
Click for Gist
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Click for Gist
Image for post
Image for post

Updating the simple UpdateCornersView class

Image for post
Image for post
Click for Gist
Image for post
Image for post
Click for Gist
Image for post
Image for post

A UIView subclass with a gradient

Image for post
Image for post
Image for post
Image for post
Click for Gist

Changing the background

override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
backgroundColor = UIColor.red
}

Conclusion:

The Twitter contact:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store