andreamazz/SlideOutNavigation

AMOptionsUseBorderedButton behaves differently

mehfuzh opened this issue · 1 comments

I want a bar button with UIBarButtonItemStylePlain style. According to these lines, it is possible by setting AMOptionsUseBorderedButton to @(YES)

if ([self.options[AMOptionsUseBorderedButton] boolValue]) {
    self.barButton = [[UIBarButtonItem alloc] initWithImage:self.options[AMOptionsButtonIcon]
                                                      style:UIBarButtonItemStylePlain
                                                     target:self
                                                     action:@selector(toggleMenu)];

    accessibilityObject = self.barButton;

}

However, there is also UIBarButtonItemStyleBordered style that actually conflicts with the term.

That's due to the behaviour of UIBarButtonItemStylePlain in iOS versions prior 7.0. With 7.0 the plain style is... plain, while on iOS6 and 5 the button was the standard bordered button. the library was born on ios5, so this explains the weird naming of that option.
If you need to support ios5 or 6, you should check against which OS version is running and change button style accordingly. If you only support iOS7, you can just set AMOptionsUseBorderedButton to @yES.