Hi, helpful guys. I've got a question.
I'm building a method in which I need to work with properties specific to an object passed as an argument. The object can either be a UIView or a UIViewController.
More specifically, if the object is a view, I need to get a list of its subviews. If it's a view controller, I need to get a list of its child view controllers.
I'm thinking what I can do is make the argument type an NSObject. Then I can use code like this:
I'm building a method in which I need to work with properties specific to an object passed as an argument. The object can either be a UIView or a UIViewController.
More specifically, if the object is a view, I need to get a list of its subviews. If it's a view controller, I need to get a list of its child view controllers.
I'm thinking what I can do is make the argument type an NSObject. Then I can use code like this:
Code:
if (theObject.class == aView.class)
{
UIView *theObject;
// do whatever I want to with the view
}
elseif (theObject.class == aViewController)
{
UIViewController *theObject;
// do whatever I want to with this controller
}