This mechanism gives us a framework (and discipline) to pass data from one conroller to another.
Every controller conforms to DataReciever
protocol which means that it will have a property model
that can be set from the caller scope.
Although, the controllers will not have to define a property again and again ‽, they still have to implement the prepare(with:)
methhod from the protocol
‽ - The property is injected into the View controllers at the runtime using Associated Objects.
Please refer SampleVC.swift
Ignore the x
in the file name this was a conspiracy to keep readme.md
on the top of the gist