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 trialAlphonse Yang
7,830 Pointswhy 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?
1 Answer
Thorsten Herbst
11,935 PointsI 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.
obey me
1,135 Pointsobey me
1,135 Pointsyou have to post your code for us to help you