Skip to content

Commit ac6468a

Browse files
author
Justin Martin
authored
Merge pull request #1292 from adamsousa/bump-ios-minimum-deployment-target
Bump ios minimum deployment target - New PR
2 parents c18a19b + 7d85058 commit ac6468a

8 files changed

+46
-60
lines changed

KIF Tests/ModalViewTests.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ - (void)testInteractionWithAnAlertView
3131

3232
- (void)testInteractionWithAnActionSheet
3333
{
34-
[tester tapViewWithAccessibilityLabel:@"UIActionSheet"];
35-
[tester waitForViewWithAccessibilityLabel:@"Action Sheet"];
34+
[tester tapViewWithAccessibilityLabel:@"UIAlertController"];
35+
[tester waitForViewWithAccessibilityLabel:@"Alert Controller"];
3636
[tester waitForTappableViewWithAccessibilityLabel:@"Destroy"];
3737
[tester waitForTappableViewWithAccessibilityLabel:@"A"];
3838
[tester waitForTappableViewWithAccessibilityLabel:@"B"];

KIF Tests/ModalViewTests_ViewTestActor.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ - (void)testInteractionWithAnAlertView
3131

3232
- (void)testInteractionWithAnActionSheet
3333
{
34-
[[viewTester usingLabel:@"UIActionSheet"] tap];
35-
[[viewTester usingLabel:@"Action Sheet"] waitForView];
34+
[[viewTester usingLabel:@"UIAlertController"] tap];
35+
[[viewTester usingLabel:@"Alert Controller"] waitForView];
3636
[[viewTester usingLabel:@"Destroy"] waitForTappableView];
3737
[[viewTester usingLabel:@"A"] waitForTappableView];
3838
[[viewTester usingLabel:@"B"] waitForTappableView];

KIF Tests/SystemTests.m

-43
Original file line numberDiff line numberDiff line change
@@ -63,48 +63,6 @@ - (void)testMemoryWarningSimulator
6363
}
6464

6565
- (void)testMockingOpenURL
66-
{
67-
__block BOOL openURLReturnValue;
68-
__block BOOL canOpenURLReturnValue;
69-
[system waitForApplicationToOpenURL:@"test123://" whileExecutingBlock:^{
70-
NSURL *uninstalledAppURL = [NSURL URLWithString:@"test123://"];
71-
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:uninstalledAppURL];
72-
openURLReturnValue = [[UIApplication sharedApplication] openURL:uninstalledAppURL];
73-
} returning:NO];
74-
KIFAssertEqual(NO, openURLReturnValue, @"openURL: should have returned NO");
75-
KIFAssertEqual(NO, canOpenURLReturnValue, @"canOpenURL: should have returned NO");
76-
77-
[system waitForApplicationToOpenURL:@"test123://" whileExecutingBlock:^{
78-
NSURL *installedAppURL = [NSURL URLWithString:@"test123://"];
79-
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:installedAppURL];
80-
openURLReturnValue = [[UIApplication sharedApplication] openURL:installedAppURL];
81-
} returning:YES];
82-
KIFAssertEqual(YES, openURLReturnValue, @"openURL: should have returned YES");
83-
KIFAssertEqual(YES, canOpenURLReturnValue, @"canOpenURL: should have returned YES");
84-
85-
[system waitForApplicationToOpenURLWithScheme:@"test123" whileExecutingBlock:^{
86-
NSURL *installedAppURL = [NSURL URLWithString:@"test123://some/path?query"];
87-
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:installedAppURL];
88-
openURLReturnValue = [[UIApplication sharedApplication] openURL:installedAppURL];
89-
} returning:YES];
90-
KIFAssertEqual(YES, openURLReturnValue, @"openURL: should have returned YES");
91-
KIFAssertEqual(YES, canOpenURLReturnValue, @"canOpenURL: should have returned YES");
92-
93-
[system waitForApplicationToOpenAnyURLWhileExecutingBlock:^{
94-
NSURL *someURL = [NSURL URLWithString:@"423543523454://"];
95-
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:someURL];
96-
openURLReturnValue = [[UIApplication sharedApplication] openURL:someURL];
97-
} returning:YES];
98-
KIFAssertEqual(YES, openURLReturnValue, @"openURL: should have returned YES");
99-
KIFAssertEqual(YES, canOpenURLReturnValue, @"canOpenURL: should have returned YES");
100-
101-
NSURL *fakeURL = [NSURL URLWithString:@"this-is-a-fake-url://"];
102-
KIFAssertFalse([[UIApplication sharedApplication] canOpenURL:fakeURL], @"Should no longer be mocking, reject bad URL.");
103-
KIFAssertFalse([[UIApplication sharedApplication] openURL:fakeURL], @"Should no longer be mocking, reject bad URL.");
104-
}
105-
106-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
107-
- (void)testMockingOpenURLiOS10xAndUp
10866
{
10967
__block BOOL canOpenURLReturnValue;
11068
[system waitForApplicationToOpenURL:@"test123://" whileExecutingBlock:^{
@@ -138,6 +96,5 @@ - (void)testMockingOpenURLiOS10xAndUp
13896
NSURL *fakeURL = [NSURL URLWithString:@"this-is-a-fake-url://"];
13997
KIFAssertFalse([[UIApplication sharedApplication] canOpenURL:fakeURL], @"Should no longer be mocking, reject bad URL.");
14098
}
141-
#endif
14299

143100
@end

KIF.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Pod::Spec.new do |s|
66
s.license = 'Apache 2.0'
77
s.authors = 'Michael Thole', 'Eric Firestone', 'Jim Puls', 'Brian Nickel'
88
s.source = { :git => "https://github.com/kif-framework/KIF.git", :tag => "v#{ s.version.to_s }" }
9-
s.platform = :ios, '10.0'
9+
s.platform = :ios, '11.0'
1010
s.frameworks = 'CoreGraphics', 'QuartzCore', 'IOKit', 'WebKit', 'XCTest'
1111
s.default_subspec = 'Core'
1212
s.requires_arc = true

KIF.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@
17891789
GCC_WARN_UNINITIALIZED_AUTOS = YES;
17901790
GCC_WARN_UNUSED_FUNCTION = YES;
17911791
GCC_WARN_UNUSED_VARIABLE = YES;
1792-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1792+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
17931793
ONLY_ACTIVE_ARCH = YES;
17941794
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
17951795
SDKROOT = iphoneos;
@@ -1834,7 +1834,7 @@
18341834
GCC_WARN_UNINITIALIZED_AUTOS = YES;
18351835
GCC_WARN_UNUSED_FUNCTION = YES;
18361836
GCC_WARN_UNUSED_VARIABLE = YES;
1837-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1837+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
18381838
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
18391839
SDKROOT = iphoneos;
18401840
SKIP_INSTALL = YES;
@@ -2097,7 +2097,7 @@
20972097
GCC_WARN_UNINITIALIZED_AUTOS = YES;
20982098
GCC_WARN_UNUSED_FUNCTION = YES;
20992099
GCC_WARN_UNUSED_VARIABLE = YES;
2100-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
2100+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
21012101
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
21022102
SDKROOT = iphoneos;
21032103
SKIP_INSTALL = YES;

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageDescription
55
let package = Package(
66
name: "KIF",
77
platforms: [
8-
.iOS(.v9)
8+
.iOS(.v11)
99
],
1010
products: [
1111
.library(

Test Host/Base.lproj/MainStoryboard.storyboard

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="3">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="3">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
77
<capability name="System colors in document resources" minToolsVersion="11.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -317,7 +317,7 @@
317317
<rect key="frame" x="0.0" y="0.0" width="383.5" height="44"/>
318318
<autoresizingMask key="autoresizingMask"/>
319319
<subviews>
320-
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="UIActionSheet" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Iob-Ej-M2H">
320+
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="UIAlertController" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Iob-Ej-M2H">
321321
<rect key="frame" x="20" y="0.0" width="355.5" height="44"/>
322322
<autoresizingMask key="autoresizingMask"/>
323323
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>

Test Host/TestSuiteViewController.m

+34-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#import <UIKit/UIKit.h>
1010

11-
@interface TestSuiteViewController : UITableViewController <UIActionSheetDelegate>
11+
@interface TestSuiteViewController : UITableViewController
1212
@end
1313

1414
@implementation TestSuiteViewController
@@ -70,7 +70,31 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
7070

7171
case 2:
7272
{
73-
[[[UIActionSheet alloc] initWithTitle:@"Action Sheet" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destroy" otherButtonTitles:@"A", @"B", nil] showInView:tableView];
73+
UIAlertController *alertController = [UIAlertController
74+
alertControllerWithTitle:@"Alert Controller"
75+
message:@""
76+
preferredStyle:UIAlertControllerStyleActionSheet];
77+
UIAlertAction *destroyAction = [UIAlertAction actionWithTitle:@"Destroy" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
78+
[self alertControllerDismissed];
79+
}];
80+
81+
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
82+
[self alertControllerDismissed];
83+
}];
84+
85+
[alertController addAction:destroyAction];
86+
[alertController addAction:[self alertActionWithTitle:@"A"]];
87+
[alertController addAction:[self alertActionWithTitle:@"B"]];
88+
[alertController addAction:cancelAction];
89+
90+
if ([alertController respondsToSelector:@selector(popoverPresentationController)] && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
91+
// iOS 8 iPad presents in a popover
92+
alertController.popoverPresentationController.sourceView = [tableView cellForRowAtIndexPath:indexPath];
93+
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:alertController];
94+
[popover presentPopoverFromRect:alertController.popoverPresentationController.sourceView.frame inView:tableView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
95+
} else {
96+
[self presentViewController:alertController animated:YES completion:nil];
97+
}
7498
break;
7599
}
76100

@@ -103,9 +127,7 @@ -(void)pullToRefreshHandler
103127
});
104128
}
105129

106-
#pragma mark - UIActionSheetDelegate
107-
108-
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
130+
- (void)alertControllerDismissed
109131
{
110132
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"Alert View"
111133
message:@"Message"
@@ -115,6 +137,13 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
115137
[self presentViewController:alertController animated:YES completion:nil];
116138
}
117139

140+
-(UIAlertAction *)alertActionWithTitle:(NSString *)title
141+
{
142+
return [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
143+
[self alertControllerDismissed];
144+
}];
145+
}
146+
118147
- (IBAction)resetRefreshControl
119148
{
120149
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Refreshing...", @"") attributes:nil];

0 commit comments

Comments
 (0)