报错啊亲~~

来源:5-7 字典实战和UIKit初探

Jaywoo8813

2015-07-07 10:33

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回答

  • 小大熊猫
    2015-08-06 13:35:30

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

玩儿转Swift

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

57181 学习 · 511 问题

查看课程

相似问题