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

Fun Facts Remix

Hello fellow iOS coders. I wanted to share a small modification I added onto the Fun Facts app. I'd also like to see what other people have done too. I added a fade-in effect to the funFactLabel.text The first step is to set the alpha to 0, followed by animationWithDuration for about two seconds and returning the alpha to 1.

Sample Code:

 @IBAction func showFunFact() {

        funFactLabel.alpha = 0 

        var randomColor = colorWheel.randomColor()
        view.backgroundColor = randomColor
        funFactButton.tintColor = randomColor
        funFactLabel.text = factBook.randomFact()

        UIView.animateWithDuration(2.0, animations: {
            self.funFactLabel.alpha = 1.0
        })
   }
}

Cool.