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

Lana Wong
Lana Wong
3,968 Points

My tintColor in Xcode isn't working.

I am taking Swift 3 basics, and I copied what Pasan did for another project similar to the Fun Facts. My tint color isn't changing. Anyone know why this happens?

Kenneth Dubroff
Kenneth Dubroff
10,612 Points

Can you provide the code you used in your second project? Depending on your data structure, something earlier in your code may be causing that portion not to execute... among other things

Lana Wong
Lana Wong
3,968 Points
import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var LanaFactLabel: UILabel!
    @IBOutlet weak var LanaSumonFacts: UIButton!

    let lanaFactProvider = LanaFactProvider()
    let colorProvider = LanaColorProvider()


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        LanaFactLabel.text = "Hi, I will be talking a little about myself"
        view.backgroundColor = colorProvider.randomColor()//Not nessesary.  I just did it, and it still works.

    }
       override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.

    }

    @IBAction func LanaFactButton() {
    LanaFactLabel.text = lanaFactProvider.randomFact()
        let randomColor = colorProvider.randomColor() //Struct. bg color
        view.backgroundColor = randomColor
        LanaSumonFacts.tintColor = randomColor
        }


}