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

    }