我正在嘗試添加一個操作表。從我讀過的內容來看,UIActionSheet在IOS 8中折舊,而應該使用Alert Controller。這裏是我的代碼片段:Swift - UIAlertAction - 找不到成員Default?
let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
let takePhoto = UIAlertAction(title: "Take Photo", style: .Default, handler: { (alert: UIAlertAction) -> Void in
//action goes here
})
但是,我收到一個錯誤,其中顯示「無法找到成員'默認'」。根據我的理解,UIAlertAction有三種可能的樣式:默認,取消&破壞性。我究竟做錯了什麼?
非常感謝:)