Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Simple iPhone App with Swift Improving Our User Interface Random Colors

Jordan Ward
Jordan Ward
2,395 Points

Hey guys in my version of Xcode tint.Color is passing compiler but not doing the command in the app.

So I typed FunFactLabel.tintColor = randomColor and it passed compiler fine. But in the app itself the text did not change color. So I went to the storyboard and manual changed it and for me it would change under text Color not tint Color. I wonder if anyone has the same thing. I tried to use under UIColor textColor but nothing came up. Any help would be great.

1 Answer

Jeff McDivitt
Jeff McDivitt
23,970 Points

You should be using it not he button not the label

    @IBAction func getFactsBtn(_ sender: Any) {

        factsLabel.text = factProvidor.randomFact()
        let randomColor = colorProvidor.randomColor()
        view.backgroundColor = randomColor
       \\Here is the button
        funFactBtn.tintColor = randomColor