Equality on Objective-C typedef enum in Swift

前端 未结 4 731
误落风尘
误落风尘 2021-02-19 08:01

I\'m working with the Facebook Objective-C SDK in Swift and I\'m trying to compare an FBSessionState value with a value from the enum. However I get the compiler error:

4条回答
  •  北海茫月
    2021-02-19 08:35

    Adding to Nikolai Nagorny's answer, this is what worked for me:

    if (device.deviceType.value == TYPE_BLUETOOTHNA.value)
    

提交回复
热议问题