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

Eduardo Rojas
Eduardo Rojas
4,084 Points

can i have the animation in another viewController?

I hate having lots of code in the same plase so i try to divide some in classes so im planning to have a vc for all my animations(because im having more than 5) and if i add them all in the same vc it will be hard to manage the rest of my code

1 Answer

Stone Preston
Stone Preston
42,016 Points

While its a good idea to divide up code, im not sure its the right idea to put code for your animations in a view controller class if all this class is going to do is store animations. If you did it this way you would have to instantiate a view controller to get access to them, and the view controller wouldnt be used for anything. You should probably just create a class called animations and use that.

What kind of animations are these? What are they for

Eduardo Rojas
Eduardo Rojas
4,084 Points

when a button is clicked it checks for a condition and if the condition is accomplished it displays the animation the animations are 24 frames each. and i have around 5 and maybe ill add more