From 432de7386508f7df303ebbfc50adfe7b5c7aad54 Mon Sep 17 00:00:00 2001 From: Kashif Hisam Date: Tue, 7 Apr 2015 20:08:23 +0500 Subject: [PATCH] iOS 5.1.1 compatibility added - ActionSheetPicker-iOS6-7: autolayout removal in storyboard - some minor fixes in order to be iOS5 compatible --- .../project.pbxproj | 4 +- .../Example/Classes/TestTableViewController.m | 8 +- Example-for-iOS-7-and-6/Storyboard.storyboard | 144 ++++++------------ Pickers/AbstractActionSheetPicker.m | 12 +- Pickers/ActionSheetLocalePicker.m | 3 +- 5 files changed, 64 insertions(+), 107 deletions(-) diff --git a/Example-for-iOS-7-and-6/ActionSheetPicker-iOS6-7.xcodeproj/project.pbxproj b/Example-for-iOS-7-and-6/ActionSheetPicker-iOS6-7.xcodeproj/project.pbxproj index 23bb6fab4..6d7d20821 100755 --- a/Example-for-iOS-7-and-6/ActionSheetPicker-iOS6-7.xcodeproj/project.pbxproj +++ b/Example-for-iOS-7-and-6/ActionSheetPicker-iOS6-7.xcodeproj/project.pbxproj @@ -310,7 +310,7 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; INFOPLIST_FILE = "ActionSheetPicker-iOS6-7-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "ActionSheetPicker-iOS6-7"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -328,7 +328,7 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; INFOPLIST_FILE = "ActionSheetPicker-iOS6-7-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "ActionSheetPicker-iOS6-7"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Example-for-iOS-7-and-6/Example/Classes/TestTableViewController.m b/Example-for-iOS-7-and-6/Example/Classes/TestTableViewController.m index 4f46b6245..135188aff 100644 --- a/Example-for-iOS-7-and-6/Example/Classes/TestTableViewController.m +++ b/Example-for-iOS-7-and-6/Example/Classes/TestTableViewController.m @@ -18,8 +18,12 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"cellId" - forIndexPath:indexPath]; + UITableViewCell *cell; + if ([self.tableView respondsToSelector:@selector(dequeueReusableCellWithIdentifier:forIndexPath:)]) + cell = [self.tableView dequeueReusableCellWithIdentifier:@"cellId" + forIndexPath:indexPath]; + else + cell = [self.tableView dequeueReusableCellWithIdentifier:@"cellId"]; cell.textLabel.text = @(indexPath.row).stringValue; cell.detailTextLabel.text = @"Choose me!"; diff --git a/Example-for-iOS-7-and-6/Storyboard.storyboard b/Example-for-iOS-7-and-6/Storyboard.storyboard index a932a6124..73f452050 100644 --- a/Example-for-iOS-7-and-6/Storyboard.storyboard +++ b/Example-for-iOS-7-and-6/Storyboard.storyboard @@ -1,28 +1,25 @@ - + - - + - - - - - + + - + + @@ -30,8 +27,9 @@ - + + @@ -39,8 +37,9 @@ - + + @@ -48,12 +47,9 @@ - + - - - - + @@ -61,8 +57,9 @@ - + + @@ -70,8 +67,9 @@ - + + @@ -79,8 +77,9 @@ - + + @@ -88,20 +87,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -272,20 +216,17 @@ - + - - - - - + + @@ -294,20 +235,23 @@ -