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 trialRaghav Bhasin
2,657 PointsUIColor is an unresolved identifier, while running the test code in the playground. How to fix that?
I wrote, var redColor = UIColor(red : 223/255.0, green : 86/255.0, blue : 94/255.0, alpha : 1.0)
4 Answers
oivindberg
Full Stack JavaScript Techdegree Graduate 43,923 PointsDid you remember import UIKit at the top of your code?
Raghav Bhasin
2,657 PointsYes I did, some other problem. Thanks.
oivindberg
Full Stack JavaScript Techdegree Graduate 43,923 PointsDo you have some other code in the playground that may cause the problem? Do you have the latest version of Xcode? It works for me when I copy your code over to an empty playground with import UIKit at the top.
Raghav Bhasin
2,657 PointsI wasn't working in the playground, I was writing in a separate swift file. Yes, I have the latest version of Xcode and I tried both @import UIKit and import UIKit at different times. I switched the simulator to iPhone 5s from iPhone 5 and it worked, don't know how.