Drop me an email if you'd like to hire me (part time) or learn more about what I do. You can read about my experience and references on LinkedIn.
iOS: Passing data back using unwind segue instead of delegate pattern
This is just a little thing that I noticed today. I thought it might be worth
to share with you.
Usually when I created a view controller that is used as a picker, it shows up
from the bottom of a screen over the current context, and covers just a part of
the screen. After a value is picked, it is passed back to a view controller that
presented the picker using delegate pattern. It looked a bit like the following code.
So, as you can see I used a segue to present the picker, but I am using delegate
pattern to get the selected data back.
Today I learned that in such case unwind segue fits better. I do not have to use
delegate pattern. And this is how it look like.
Is it better? For me, in this specific case - YES.