This is how I check enum type. Is it a way not do it with switch but shorter?
if let i = instance as? DataToValidate {
switch i {
case .object:
return true
default:
return false
}
} else {
return false
}
And my type:
public enum DataToValidate {
case object(JSONObject)
case array(JSONArray)
case string(String)
}