Easy Initializers #XcodeExplore

Alireza Eram
Dec 13, 2020

--

We can create initializer in 2 steps instead of writing all those boring repeated codes:

  1. click on class name + cmd

2. Click on Generate Memberwise Initializer and here we have it:

Xcode is smart enough to differentiate between stored and computed properties. While writing unit tests for Codables this is very handy and saves time.

have fun ;)

--

--

No responses yet