import UIKit
let colors =
[
"Air Force Bule":(red:93,green:138,bule:168),
"Bittersweet":(red:254,green:111,blue:94),
"Canary Yellow":(red:255,green:239,blue:0),
"Dark Orange":(red:255,green:140,blue:0),
"Electric Violet":(red:143,green:0,blue:255),
"Fern":(red:113,green:188,blue:120),
"Gamboge":(red:228,green:155,blue:15),
"Hollywood Cerise":(red:244,green:0,blue:94),
"Icterine":(red:252,green:247,blue:94),
"Jazzberry Jam":(red:165,green:11,blue:94)
]
var backView = UIView( frame: CGRectMake(0.0, 0.0, 320.0, CGFloat(colors.count * 50)) )
backView.backgroundColor = UIColor.blackColor()
backView
Console Output显示是:
Playground execution failed: Learning Test.playground:6:1: error: type '(red: IntegerLiteralConvertible, green: IntegerLiteralConvertible, blue: IntegerLiteralConvertible)' does not conform to protocol 'AnyObject'
[
^
到底哪个地方有问题啊~
你第一个颜色的blue打错了啊亲