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

object Oriented Swift 2.0

why is not working it tells me bummer don't use the member wise initializer swift creates. add your own custom initializer in the directions

struct RGBColor { let red: Double let green: Double let blue: Double let alpha: Double

let description: String

// Add your code below

init (red: double, green: double, blue: Double, alpha: Double, description: [Double] { method.red = red method.green = green method.blue = blue method.alpha = alpha

}

3 Answers

thank you for your help i figured out!!! Thank you so much!!!!

Hello Carmen, You will need to be careful when declaring the data types in your init method. Some instances of "Double" are not capitalized and that will result in an error.

For the purposes of the challenge, the description should be a String and not an Array of Doubles. Make sure that your string returns the format that is present in the challenge, so you'll use a combination of quotations (") and be inserting the values from the struct using "\( )".

Finally, when assigning values to the struct, you want to use "self" and not "method". example: "self.red = red"

One final detail that may cause a problem... It may be a case of how you copied and pasted your code into the data, but you are also missing an end bracket "}" in your command.

Good luck!

Thank you Daniel Cunningham! But still don't work =(

I'm sorry to hear that! Can you send over where you stand with the code currently? Also, for posting, it helps to use the "```"characters in front of and at the end of your code.