Permalink
Browse files

Fix semantic warnings in iOS5 and Xcode 4.2

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...
1 parent 60367ef commit 82d95f5a2b3cf60ed20deb2c3405d0c0be5a7ed4 @ma11hew28 ma11hew28 committed with Christine Abernathy Oct 13, 2011
Showing with 8 additions and 9 deletions.
  1. +1 −1 src/FBDialog.h
  2. +7 −8 src/FBDialog.m
View
@@ -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.
View
@@ -31,7 +31,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-BOOL FBIsDeviceIPad() {
+static BOOL FBIsDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
@@ -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;
}
}
@@ -290,7 +290,6 @@ - (id)init {
if (self == [super initWithFrame:CGRectZero]) {
_delegate = nil;
_loadingURL = nil;
- _orientation = UIDeviceOrientationUnknown;
_showingKeyboard = NO;
self.backgroundColor = [UIColor clearColor];
@@ -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];

0 comments on commit 82d95f5

Please sign in to comment.