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 Weather App with Swift (Retired) Displaying Our Weather Data The End!

Rodrigo Savage
Rodrigo Savage
1,756 Points

Get refresh icon on swipe down.

I was just wondering, instead of the refresh button staying there, how about using swipe down on the screen to call the refresh button functionality?

Also like the spotlight functionality in iOS, how do I display a button ( or a text field) when I swipe down on the screen?

Thanks a lot in advance.

1 Answer

You could look into the UIScrollViewDelegate methods (such as scrollViewDidScroll), then compare the content-offset to some value, and take action accordingly.

You could also have icons with a negative y coordinate within the scrollview (so that they're above the top of the screen).