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 trialCarl Smith
8,185 PointsCompletely lost on how to do this challenge.
So I created a property called "blueColor" nested in the ViewController. Confused on creating an instance using UIColor.blueColor() and passing in the values provided.
class ViewController: UIViewController {
let blueColor()
override func viewDidLoad() {
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
// Dispose of any resources that can be recreated
}
UIColor.blueColor(0, 0, 255, 1.0)
}
1 Answer
Greg Kaleka
39,021 PointsHi Carl,
I really strongly recommend you go back and watch the last couple of videos, starting with this one. I try not to give out answers when students seem to not have really gotten what they should have out of the videos. I think if you watch the videos again with this challenge in mind, you'll be able to solve it on your own. Let us know when you do, or if you still have trouble!
Quick tip about your property - the code you wrote would not compile. To create a stored property, you need to write let variableName = somethingOverHere
. You can't have a function or method on the left side of the equal sign.
Good luck!
Carl Smith
8,185 PointsCarl Smith
8,185 PointsThank you for helping me like that. I started in the video after the one you recommended I started at the I went back for reference. I have passed the challenge and I did it all while learning on my own. Usually people give me the answer, which I still deconstruct and learn from. However, this felt like a greater accomplishment doing it on my own. Thank you!