Passing Data Between View Controllers in iOS

Passing Data Between View Controllers in iOS: the Definitive Guide (Best Practices + Examples)

http://matteomanferdini.com/how-ios-view-controllers-communicate-with-each-other/

I want to pass some information from a child (or destination) view controller to a parent (or source) view controller. The above webpage explains very well how to do the job.

As quoted in the above webpage,

Always use a delegate to communicate information back to other controllers. Your content view controller should never need to know the class of the source view controller or any controllers it doesn’t create.

So I must not create any references of a parent view controller in a child view controller.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s