Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Diary App Using Core Data Inserting and Saving Data UI for Inserting Diary Entries

Alphonse Yang
Alphonse Yang
7,830 Points

why to use self.presentingViewController

I found if I just call dismissViewController method of self instead of self.presentingViewController, I got the same result, so why to use the self.presentingViewController?

obey me
obey me
1,135 Points

you have to post your code for us to help you

1 Answer

I think its following, but iam not sure... With self.presentingViewController you`re sending the message to the presenting ViewController which is the RootViewController under the modal ViewController. So you will give the control to the RootViewController. Otherwise, if you call self dismiss the control is being hold at the modal View Controller which is; so i think...inconvenient.

@ All Please give Feedback and correct me if necessary.