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

Animated gradient layer for SWIFT

Just out of interest, I would like to animate gradient colors of a background view in SWIFT i.e. either fade out or fade in the colors as the instagram app home page as example. How do I carry this out

2 Answers

I think you have to make a whole bunch of images and use UIImage animation, here are a couple links that might help.

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/

https://teamtreehouse.com/library/build-a-simple-iphone-app-ios7/animating-and-intercepting-events/image-based-animation

The Treehouse video is in Obj-C so you will need to adapt it.

Hi Caleb Kleveter , thanks for your response, that was indeed helpful. However I found this linked which helped [http://stackoverflow.com/questions/14920768/creating-an-animated-gradient-background-similar-to-the-solar-weather-applicatio] . What I intend to achieve is to have a radial gradient animation change instead

I'm glad you got it! Happy coding!