cocoatoucher/AIFlatSwitch

OnSwitchValueChanged cast issue

Alex-Catchpole opened this issue · 1 comments

The example you provided for OnSwitchValueChanged doesn't seem to work. The casting will always fail. When trying to implicitly cast as AIFlatSwitch like so I get an error.

//Cast
let coolSwitch = sender as! AIFlatSwitch

//Error
Could not cast value of type 'AIFlatSwitch.AIFlatSwitch' (0x23c588) to 'aiflatswitch.AIFlatSwitch' (0xc8428).

Is this a bug or am I doing something wrong?

Hi Alex, "sender as! AIFlatSwitch" seems to be working for me when the framework is used as a Swift module with cocoapods.
Is there any chance you are using a different configuration?
Did you try logging the type of "sender" with println(sender.self) and cast it with what the result is?