MBSwitch icon indicating copy to clipboard operation
MBSwitch copied to clipboard

How to add MBSwitch as Bar Button Item

Open bhartsb opened this issue 7 years ago • 1 comments

How would one add MBSwitch as or into a Bar Button Item in the navigation bar? I've so far been unable to do this.

bhartsb avatar Jul 20 '16 14:07 bhartsb

Seems to do it: UIBarButtonItem *switchButtonBarItem = [[UIBarButtonItem alloc]initWithCustomView:_filterSwitch]; NSArray * a = [self.navigationItem.leftBarButtonItems arrayByAddingObject:switchButtonBarItem]; self.navigationItem.leftBarButtonItems = a;

bhartsb avatar Jul 20 '16 23:07 bhartsb