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 trialMatthew Giuliano
2,749 PointsHow would I do this?
Thanks
class ViewController: UIViewController {
@IBOutlet weak var timerButton: UIButton!
var redColor: UIColor = UIColor.redColor()
override func viewDidLoad() {
super.viewDidLoad()
@IBOutlet weak vat timerButton: UIButton!
var setTitle: UIButton = UIButton.setTitle()
func setTitle(_ title: "Start")
}
}
2 Answers
Steve Hunter
57,712 PointsHi,
These are a little fiddly, I agree. Try something like:
timerButton.setTitle("Start", forState: .Normal)
The documentation isn't mega-clear at all, unfortunately.
Steve.
Steve Hunter
57,712 PointsHi Matthew,
What are you trying to do here? Is this a code challenge or something you're working on yourself?
Either way, let us know what the intended end result is and we can help you fix it!
Steve.
Matthew Giuliano
2,749 PointsThese are the directions: Letβs assume we have an IBOutlet of type UIButton, named timerButton, as a property in the ViewController.swift file. In the viewDidLoad method, set the title of the button to βStartβ for the state configuration Normal.
And I can't seem to figure out how to format this all correctly.
Matthew Giuliano
2,749 PointsMatthew Giuliano
2,749 PointsYes that worked, thank you.