2016-05-27 68 views

回答

4

@George阿斯達:

上來的錯誤是「不能價值型‘的UIColor’轉換爲預期的參數類型‘UIColor.Type’」

時類型的UIColor的空數組是錯誤消失設置例如下面我複製了它...

var uiColorArray = [UIColor]() // Empty Array of type UIColor 

隨後,當我追加和removeLast就像你在每個階段例如打印,都沒有任何錯誤顯示正常...例如在Func裏面...

self.uiColorArray.append(UIColor.blueColor) // in Swift 3, its UIColor.blue 
    print(uiColorArray) 

    self.uiColorArray.removeLast() 
    print(uiColorArray) 

錯誤消失了。

1

更新了夫特3

let colorArray = [UIColor.red, UIColor.green, UIColor.blue]