andreamazz / SlideOutNavigation

SlideOut Navigation Controller for iOS.
MIT License
210 stars 49 forks source link

AMOptionsUseBorderedButton behaves differently #65

Closed mehfuzh closed 10 years ago

mehfuzh commented 10 years ago

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.

andreamazz commented 10 years ago

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.