Tag Archives: willSet

willSet didSet example swift – How to use ?

willSet didSet example swift willSet and didSet are called property observers. They observe the changes in the value of a property. willSet observe what changes are made that means new value and didSet observe what change was made that is old value.


willSet method swift programming – how it works ?

willSet method swift programming The code that’s written in this method is run anytime outside the initializer.

On setting up square sideLength, it will set the triangle sideLength by self. There’s another method didSet as well and that we will see in later on posts.