8
目標是將以下條件更新爲Swift 2.2語法,該語法建議使用#selector or explicitly constructing a Selector
。#selector的參數不能引用屬性
if activityViewController.respondsToSelector("popoverPresentationController") {
}
但是,使用下面的作爲替代失敗並生成一個錯誤說Argument of #selector cannot refer to a property
if activityViewController.respondsToSelector(#selector(popoverPresentationController)) {
}
什麼是執行這一檢查與#selector
的正確方法?
popOverPresentationController是屬性不一個功能。對? – Darko