Skip to content

This is the simpliest example of what we can do with IBDesignable and IBInspectable with Swift on iOS.

Notifications You must be signed in to change notification settings

egzonpllana/DynamicComponentView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DynamicComponentView

Screen Shot 2020-07-13 at 11

Create your custom views faster with Interface Builder

@IBDesignable provides functionality for live rendering of changes
of our custom views directly in a Storyboard or .xib. All we have to 
do is mark the class of a custom view with a @IBDesignable attribute 
and implement the prepareForInterfaceBuilder() method.

@IBInspectable allows us to create attributes in code that we can 
assign in a storyboard or a .xib file. For example, when we want 
a cornerRadius property available in a Storyboard, we create a 
cornerRadius property inside our custom view and mark it with @IBInspectable.

@IBInspectable allows us to create attributes in code that we can
assign in a storyboard or a .xib file. For example, when we want a
cornerRadius property available in a Storyboard, we create a cornerRadius
property inside our custom view and mark it with @IBInspectable.

How to use

Connect your ResultTestView view to your viewcontroller from storyboard.
Update view dynamically whenever you need you set the values in viewDidLoad().

View attributes:
    .scoredPoints: Int
    .requiredPointsToPass: Int
    .totalPoints: Int

How to

You must set ResultView width constraint so it can calculate in efficient 
way the shifts of progress bars. 

Preview

app-live-preivew

About

This is the simpliest example of what we can do with IBDesignable and IBInspectable with Swift on iOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages