I want to change the header text on a view depending on where it has come from (so depending on the parentViewController).
Is there a way to say: if the parent view controller is viewControllerX?
For now I’ve added a protocol to viewControllerX and I’m doing
if ([self.parentViewController confromsToProcol:@protocol(vcX)])
Is there a better way?
If you are talking about ViewController instances of the same class you can add a property to the class (for example ‘myInstanceName’ and set it’s value different for each instance.
If the ViewControllers are actually different classes you can use the “class” property to compare.