Data transfer between view controllers works two ways:
From A to B. When screen A opens screen B, A can give B the data it needs. You simply make a new instance variable in B’s view controller. Screen A then puts an object into this property right before it makes screen B visible, usually in prepare(for:sender:).
From B to A.To pass data back from B to A you use a delegate.
I was wondering, when should I use delegates to pass data right away as in number 2 and when should I use segues to send the data right away as in number 1? As far as I know, both methods require the use of delegates anyways, but when should I use method 1 and when should I use method 2? The only difference I see is that method 1 loosely couples A and B but method 2 doesn’t as we hard code the variables of B in A.