我在 Xcode 6.3 中有这样的代码:
let store = EKEventStore()
for source in store.sources() {
let st: EKSourceType = source.sourceType!
if st == EKSourceTypeLocal {
localSource = source;
}
}
第五行(如果 st..)给出了编译器错误:“二元运算符 == 不能应用于两个 EKSourceType 操作数”
我如何检查源代码是否是本地的(在 Swift 中)并编译它?
最佳答案
像这样:
if st.value == EKSourceTypeLocal.value
关于ios - Swift 返回错误 'Binary operator == cannot be applied to two EKSourceType operands',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29800562/