为了账号安全,请及时绑定邮箱和手机立即绑定

报错啊亲~~

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'

[

^

到底哪个地方有问题啊~

正在回答

1 回答

你第一个颜色的blue打错了啊亲

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
玩儿转Swift
  • 参与学习       57181    人
  • 解答问题       511    个

这套教程比任何的Swift中文教程深入,并且演示示例更丰富

进入课程

报错啊亲~~

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信