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 Build a Simple iPhone App with Swift Improving Our User Interface Adding a Pop of Color

kamal bains
seal-mask
.a{fill-rule:evenodd;}techdegree
kamal bains
iOS Development Techdegree Student 1,522 Points

syncing the color of button to background

As i followed the video i had no difficulty getting the results to function correctly. But, when I added the randomColor variable to sync the color of the button text to the back ground it shows a Thread 1 : breakpoint 1.1

@IBAction func showFunFact() { var randomColor = colorWheel.randomColor() view.backgroundColor = randomColor funFactButton.tintColor = randomColor <-----------right here funFactLabel.text = factBook.randomFact()

1 Answer

Alex Rodriguez
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Rodriguez
Front End Web Development Techdegree Student 20,810 Points

Hi kamal bain, I was having the same issue, your code seems right. The way I fixed it was by going to Main.storyboard clicking on the fun fact button and on the attributes menu, go down to tint and change the color to default.

This worked for me, let me know if it works for you.