追記
こちらの書き方が可能のようです。
こっちで書きましょう
https://developers.eure.jp/event/10-tips-when-moving-from-objective-c-to-swift-ja/?utm_source=dlvr.it&utm_medium=twitter
switch文
switch someValue {
case _ as Int:
Log.d(nil, "This is Int")
case _ as String:
Log.d(nil, "This is String")
case _ as Hoge:
Log.d(nil, "This is Hoge")
default:
// unknown case
break
}
if文で同じ処理
if someValue is Int {
Log.d(nil, "This is Int")
}else if someValue is String {
Log.d(nil, "This is String")
}else if someValue is Hoge {
Log.d(nil, "This is Hoge")
}else {
// unknown case
}