I have a UIBarButtonItem (defined in Storyboard), I’ve assigned to my own custom SwitchConsumerBarButton class.
What I want to do is dictate it’s visibility on Page Init based on some criteria. I’d like to do this programmatic. I’ve tried implementing -(id) init but it doesn’t get called, how do I control the initialization of this object? I’ve looked at the different initialization methods that can be called for this type, but I don’t know which one the Storyboard will call?
@implementation SwitchBarButton
-(id) init
{
if(self = [super init]) {
NSLog(@"gwojbngowj");
}
return self;
}
@end
I’m not sure if you mean to adjust the alpha, or to hide the button outright, so here’s both.
If you are looking to create the button depending on the variable, you could do that like this: