Basically if I have a method declared and tied to a button such as:
- (IBAction) clickMe:(id)sender {
.....
}
Is there a way in this method to see whether sender is a subclass of type UIViewController and if so, somehow access something like [sender.view removeFromSuperView] ?
Is this at all possible?
Thanks!
You can use
isKindOfClass:
to determine if sender is of a certain subclass. After that you should cast sender to UIViewController to remove it’s view, else you’ll get a warning from the compiler.