我无法使用rawValue初始化程序来初始化枚举。有什么想法吗?下面是错误注释:
//: Playground - noun: a place where people can play
// Xcode Version 7.3 (7D175)
import UIKit
enum Theme {
case Default, Dark, Graphical
}
let possibleTheme = Theme(rawValue: 1)
// Error: 'Theme' cannot be constructed because it has no accessible initializers.
enum Theme : Int
。 - vadian