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

Martin Lynnerup
Martin Lynnerup
3,134 Points

How do I update a viewController or label when dismissing a modul in Swift?

The main page of a workout app I'm working on contains a label with different exercises. From the main page you can open a "settings" modul where it's possible to adjust you skill level.

When I dismiss the settings modul I need the text label to be refreshed, so it reflects the new settings.

How do I make the label (or the ViewController) refresh, when I dismiss the settings modul?

Jhoan Arango
Jhoan Arango
14,575 Points

Hello,

Are you navigating via segues ? If so you can use an unwind segue.

1 Answer

Bruce Röttgers
Bruce Röttgers
18,211 Points

Hello,

I had the same issue, when creating my first app! I solved it using presentingViewController. I put the code how I solved this (with detailed explanation) in a gist on GitHub https://gist.github.com/bcye/8fa53524e6d529162a0750471fdda0a3

Hope that's all it needs for you.

Bruce.