Skip to content

Commit

Permalink
Fix semantic warnings in iOS5 and Xcode 4.2
Browse files Browse the repository at this point in the history
Summary: Pulled from facebook#401

Test Plan:
1/ Ran on iPhone 4 device with iOS 5, Hackbook iOS app, launched feed dialog,
rotate all orientations and check works as expected. Also rotated device before
launching dialog and rotating dialog to see it performed well.
2/ Ran experiment (1) with iPhone 4.3 simulator.
3/ Ran experiment (1) with iPad 4.3 simulator.
4/ Ran experiment (1) with iPad 5.0 simulator.

Reviewers: yariv, brent

Reviewed By: yariv

CC: lshepard, yariv

Differential Revision: 354600

Revert Plan: OK

Task ID: 673148
  • Loading branch information
ma11hew28 authored and Christine Abernathy committed Nov 2, 2011
1 parent 60367ef commit 82d95f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/FBDialog.h
Expand Up @@ -33,7 +33,7 @@
UIWebView* _webView;
UIActivityIndicatorView* _spinner;
UIButton* _closeButton;
UIDeviceOrientation _orientation;
UIInterfaceOrientation _orientation;
BOOL _showingKeyboard;

// Ensures that UI elements behind the dialog are disabled.
Expand Down
15 changes: 7 additions & 8 deletions src/FBDialog.m
Expand Up @@ -31,7 +31,7 @@

///////////////////////////////////////////////////////////////////////////////////////////////////

BOOL FBIsDeviceIPad() {
static BOOL FBIsDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
Expand Down Expand Up @@ -129,14 +129,14 @@ - (void)strokeLines:(CGRect)rect stroke:(const CGFloat*)strokeColor {
CGColorSpaceRelease(space);
}

- (BOOL)shouldRotateToOrientation:(UIDeviceOrientation)orientation {
- (BOOL)shouldRotateToOrientation:(UIInterfaceOrientation)orientation {
if (orientation == _orientation) {
return NO;
} else {
return orientation == UIDeviceOrientationLandscapeLeft
|| orientation == UIDeviceOrientationLandscapeRight
|| orientation == UIDeviceOrientationPortrait
|| orientation == UIDeviceOrientationPortraitUpsideDown;
return orientation == UIInterfaceOrientationPortrait
|| orientation == UIInterfaceOrientationPortraitUpsideDown
|| orientation == UIInterfaceOrientationLandscapeLeft
|| orientation == UIInterfaceOrientationLandscapeRight;
}
}

Expand Down Expand Up @@ -290,7 +290,6 @@ - (id)init {
if (self == [super initWithFrame:CGRectZero]) {
_delegate = nil;
_loadingURL = nil;
_orientation = UIDeviceOrientationUnknown;
_showingKeyboard = NO;

self.backgroundColor = [UIColor clearColor];
Expand Down Expand Up @@ -419,7 +418,7 @@ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
// UIDeviceOrientationDidChangeNotification

- (void)deviceOrientationDidChange:(void*)object {
UIDeviceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
if (!_showingKeyboard && [self shouldRotateToOrientation:orientation]) {
[self updateWebOrientation];

Expand Down

0 comments on commit 82d95f5

Please sign in to comment.