in Obj-C a switch can only evaluate numbers. I'd like to be able to use it to compare classes of objects, something like this, for instance:
switch (currentSubViewController.class)
{
case UITableViewController.class :
<do stuff>
break;
case UICollectionViewController.class :
<do stuff>
break;
}
Is there any way to achieve this? I'd really like to be able to use a switch because it makes it so easy to read for different cases, and I can add more cases at any point in the future. Any ideas?