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 Enumerations and Optionals in Swift Introduction to Enumerations Enums with Associated Values

Stella Lu
Stella Lu
1,004 Points

What is wrong with this answer for this Enumerations & Optionals task?

I've searched, and it seems like there was an old version where there was a blackberry phone and the text was for "6S" not "7 Plus", but when I compare my code to the older version, it looks like my code follows the same rules. Why doesn't Treehouse accept this answer?

enums.swift
enum MobilePhone {
  case iPhone(String)
  case android(String)
  case windowsPhone(String)
}

let iphone = MobilePhone.iPhone("7 Plus")

1 Answer

David Papandrew
David Papandrew
8,386 Points

It may seem a bit silly, but you need to declare "iPhone" as "iphone" (all lowercase). Do this in the enum and the iphone constant declaration and it should pass.

Stella Lu
Stella Lu
1,004 Points

Wow - didn't notice that tiny detail, but it works! Thanks. :)