Skip to content

Commit

Permalink
fixes BOOL adjust which was never NO
Browse files Browse the repository at this point in the history
[controller
performSelector:@selector(automaticallyAdjustsScrollViewInsets)
withObject:nil] returns id, which cast as BOOL is always YES if not nil.

it can just call the method directly since the the minimum SDK is iOS 7
now. There is no need anymore for respondsToSelector: conditions.
  • Loading branch information
balord committed Aug 20, 2014
1 parent ad0562e commit 16949fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions SWRevealViewController/SWRevealViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,8 @@ - (void)_setFrontViewPosition:(FrontViewPosition)newPosition withDuration:(NSTim
void (^animations)() = ^()
{
// Calling this in the animation block causes the status bar to appear/dissapear in sync with our own animation
if ( [self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate) withObject:nil];

[self setNeedsStatusBarAppearanceUpdate];

// We call the layoutSubviews method on the contentView view and send a delegate, which will
// occur inside of an animation block if any animated transition is being performed
[_contentView layoutSubviews];
Expand Down Expand Up @@ -1586,9 +1585,9 @@ - (void)_performTransitionOperation:(SWRevealControllerOperation)operation withV
controllerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
controllerView.frame = frame;

if ( [controller respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)] && [controllerView isKindOfClass:[UIScrollView class]] )
if ( [controllerView isKindOfClass:[UIScrollView class]] )
{
BOOL adjust = (BOOL)[controller performSelector:@selector(automaticallyAdjustsScrollViewInsets) withObject:nil];
BOOL adjust = controller.automaticallyAdjustsScrollViewInsets;

if ( adjust )
{
Expand Down

0 comments on commit 16949fe

Please sign in to comment.