Skip to content

Commit

Permalink
Merge pull request #28 from mhaddl/master
Browse files Browse the repository at this point in the history
ADD: shouldRotateToDeviceOrientation property to disable rotation
  • Loading branch information
u10int committed Apr 20, 2014
2 parents ac2e0ef + 41f9fa9 commit 2600ce1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions URBMediaFocusViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
// determines if photo action sheet should appear with a long press on the photo (default NO)
@property (nonatomic, assign) BOOL shouldShowPhotoActions;

//determines if view should rotate when the device orientation changes (default YES)
@property (nonatomic, assign) BOOL shouldRotateToDeviceOrientation;

@property (nonatomic, weak) id<URBMediaFocusViewControllerDelegate> delegate;

// HTTP header values included in URL requests
Expand Down
5 changes: 4 additions & 1 deletion URBMediaFocusViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ - (id)init {
self.shouldDismissOnTap = YES;
self.shouldDismissOnImageTap = NO;
self.shouldShowPhotoActions = NO;
self.shouldRotateToDeviceOrientation = YES;
}
return self;
}
Expand Down Expand Up @@ -821,7 +822,9 @@ - (void)deviceOrientationChanged:(NSNotification *)notification {
UIInterfaceOrientation deviceOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
if (_currentOrientation != deviceOrientation) {
_currentOrientation = deviceOrientation;
[self reposition];
if (self.shouldRotateToDeviceOrientation) {
[self reposition];
}
}
}

Expand Down

0 comments on commit 2600ce1

Please sign in to comment.