Skip to content

Commit

Permalink
Merge pull request #38 from nowsprinting/support-large-display
Browse files Browse the repository at this point in the history
Support ActionSheet width to full-screen-width in 4.7 inch and 5.5 inch devices
  • Loading branch information
skywinder committed Sep 17, 2014
2 parents 20bd344 + 4db0536 commit 9a07141
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 3 deletions.
53 changes: 53 additions & 0 deletions ActionSheetPicker-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,59 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>5.0</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>5.0</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default-736h</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default-736w</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
Expand Down
12 changes: 12 additions & 0 deletions ActionSheetPicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
1C9444DB197B1EDE005F495B /* DistancePickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C6EE732192BB4F600A27994 /* DistancePickerView.m */; };
1CA77769199B72120076241F /* SWActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D66F5547FC9E0F428DA62D5C /* SWActionSheet.m */; };
1CFCACFD1980FA320056A594 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1CFCACFC1980FA320056A594 /* Storyboard.storyboard */; };
1D07100A19C4C7AF0033BA4D /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1D07100719C4C7AF0033BA4D /* Default-667h@2x.png */; };
1D07100B19C4C7AF0033BA4D /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1D07100819C4C7AF0033BA4D /* Default-736h@3x.png */; };
1D07100C19C4C7AF0033BA4D /* Default-736w@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1D07100919C4C7AF0033BA4D /* Default-736w@3x.png */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
Expand Down Expand Up @@ -101,6 +104,9 @@
1C9444C8197B1C75005F495B /* ActionSheetCustomPickerTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActionSheetCustomPickerTestCase.m; sourceTree = "<group>"; };
1CD15A2F192C7A0A00B28881 /* ActionSheetPicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ActionSheetPicker.app; sourceTree = BUILT_PRODUCTS_DIR; };
1CFCACFC1980FA320056A594 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard.storyboard; path = ../Storyboard.storyboard; sourceTree = "<group>"; };
1D07100719C4C7AF0033BA4D /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = "<group>"; };
1D07100819C4C7AF0033BA4D /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; };
1D07100919C4C7AF0033BA4D /* Default-736w@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736w@3x.png"; sourceTree = "<group>"; };
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -144,6 +150,9 @@
1CFCACFC1980FA320056A594 /* Storyboard.storyboard */,
1C6EE709192BB41600A27994 /* Classes */,
1C6EE712192BB41600A27994 /* Default-568h@2x.png */,
1D07100719C4C7AF0033BA4D /* Default-667h@2x.png */,
1D07100819C4C7AF0033BA4D /* Default-736h@3x.png */,
1D07100919C4C7AF0033BA4D /* Default-736w@3x.png */,
1C6EE713192BB41600A27994 /* iPad */,
1C6EE715192BB41600A27994 /* main.m */,
1C6EE716192BB41600A27994 /* MainWindow.xib */,
Expand Down Expand Up @@ -357,6 +366,9 @@
files = (
1C7A57AC199DF30B007B9B70 /* ok.png in Resources */,
1C6EE721192BB41600A27994 /* MainWindow.xib in Resources */,
1D07100C19C4C7AF0033BA4D /* Default-736w@3x.png in Resources */,
1D07100A19C4C7AF0033BA4D /* Default-667h@2x.png in Resources */,
1D07100B19C4C7AF0033BA4D /* Default-736h@3x.png in Resources */,
1C6EE71F192BB41600A27994 /* MainWindow-iPad.xib in Resources */,
1C7A57A9199DEDD5007B9B70 /* cancel.png in Resources */,
1C6EE71E192BB41600A27994 /* Default-568h@2x.png in Resources */,
Expand Down
Binary file added Example/Default-667h@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/Default-736h@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/Default-736w@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions Pickers/AbstractActionSheetPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,16 @@ - (CGSize)viewSize
return CGSizeMake(320, 320);
}

if ( [self isViewPortrait] )
return CGSizeMake(320 , IS_WIDESCREEN ? 568 : 480);
return CGSizeMake(IS_WIDESCREEN ? 568 : 480, 320);
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1) {
//iOS 7.1 or earlier
if ( [self isViewPortrait] )
return CGSizeMake(320 , IS_WIDESCREEN ? 568 : 480);
return CGSizeMake(IS_WIDESCREEN ? 568 : 480, 320);

}else{
//iOS 8 or later
return [[UIScreen mainScreen] bounds].size;
}
}

- (BOOL)isViewPortrait
Expand Down

0 comments on commit 9a07141

Please sign in to comment.