Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump iOS minimum iOS deployment target to 11.0 #1283

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions KIF Tests/ModalViewTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ - (void)testInteractionWithAnAlertView

- (void)testInteractionWithAnActionSheet
{
[tester tapViewWithAccessibilityLabel:@"UIActionSheet"];
[tester waitForViewWithAccessibilityLabel:@"Action Sheet"];
[tester tapViewWithAccessibilityLabel:@"UIAlertController"];
[tester waitForViewWithAccessibilityLabel:@"Alert Controller"];
[tester waitForTappableViewWithAccessibilityLabel:@"Destroy"];
[tester waitForTappableViewWithAccessibilityLabel:@"A"];
[tester waitForTappableViewWithAccessibilityLabel:@"B"];
Expand Down
4 changes: 2 additions & 2 deletions KIF Tests/ModalViewTests_ViewTestActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ - (void)testInteractionWithAnAlertView

- (void)testInteractionWithAnActionSheet
{
[[viewTester usingLabel:@"UIActionSheet"] tap];
[[viewTester usingLabel:@"Action Sheet"] waitForView];
[[viewTester usingLabel:@"UIAlertController"] tap];
[[viewTester usingLabel:@"Alert Controller"] waitForView];
[[viewTester usingLabel:@"Destroy"] waitForTappableView];
[[viewTester usingLabel:@"A"] waitForTappableView];
[[viewTester usingLabel:@"B"] waitForTappableView];
Expand Down
43 changes: 0 additions & 43 deletions KIF Tests/SystemTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,48 +63,6 @@ - (void)testMemoryWarningSimulator
}

- (void)testMockingOpenURL
{
__block BOOL openURLReturnValue;
__block BOOL canOpenURLReturnValue;
[system waitForApplicationToOpenURL:@"test123://" whileExecutingBlock:^{
NSURL *uninstalledAppURL = [NSURL URLWithString:@"test123://"];
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:uninstalledAppURL];
openURLReturnValue = [[UIApplication sharedApplication] openURL:uninstalledAppURL];
} returning:NO];
KIFAssertEqual(NO, openURLReturnValue, @"openURL: should have returned NO");
KIFAssertEqual(NO, canOpenURLReturnValue, @"canOpenURL: should have returned NO");

[system waitForApplicationToOpenURL:@"test123://" whileExecutingBlock:^{
NSURL *installedAppURL = [NSURL URLWithString:@"test123://"];
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:installedAppURL];
openURLReturnValue = [[UIApplication sharedApplication] openURL:installedAppURL];
} returning:YES];
KIFAssertEqual(YES, openURLReturnValue, @"openURL: should have returned YES");
KIFAssertEqual(YES, canOpenURLReturnValue, @"canOpenURL: should have returned YES");

[system waitForApplicationToOpenURLWithScheme:@"test123" whileExecutingBlock:^{
NSURL *installedAppURL = [NSURL URLWithString:@"test123://some/path?query"];
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:installedAppURL];
openURLReturnValue = [[UIApplication sharedApplication] openURL:installedAppURL];
} returning:YES];
KIFAssertEqual(YES, openURLReturnValue, @"openURL: should have returned YES");
KIFAssertEqual(YES, canOpenURLReturnValue, @"canOpenURL: should have returned YES");

[system waitForApplicationToOpenAnyURLWhileExecutingBlock:^{
NSURL *someURL = [NSURL URLWithString:@"423543523454://"];
canOpenURLReturnValue = [[UIApplication sharedApplication] canOpenURL:someURL];
openURLReturnValue = [[UIApplication sharedApplication] openURL:someURL];
} returning:YES];
KIFAssertEqual(YES, openURLReturnValue, @"openURL: should have returned YES");
KIFAssertEqual(YES, canOpenURLReturnValue, @"canOpenURL: should have returned YES");

NSURL *fakeURL = [NSURL URLWithString:@"this-is-a-fake-url://"];
KIFAssertFalse([[UIApplication sharedApplication] canOpenURL:fakeURL], @"Should no longer be mocking, reject bad URL.");
KIFAssertFalse([[UIApplication sharedApplication] openURL:fakeURL], @"Should no longer be mocking, reject bad URL.");
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
- (void)testMockingOpenURLiOS10xAndUp
{
__block BOOL canOpenURLReturnValue;
[system waitForApplicationToOpenURL:@"test123://" whileExecutingBlock:^{
Expand Down Expand Up @@ -138,6 +96,5 @@ - (void)testMockingOpenURLiOS10xAndUp
NSURL *fakeURL = [NSURL URLWithString:@"this-is-a-fake-url://"];
KIFAssertFalse([[UIApplication sharedApplication] canOpenURL:fakeURL], @"Should no longer be mocking, reject bad URL.");
}
#endif

@end
2 changes: 1 addition & 1 deletion KIF.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |s|
s.license = 'Apache 2.0'
s.authors = 'Michael Thole', 'Eric Firestone', 'Jim Puls', 'Brian Nickel'
s.source = { :git => "https://github.com/kif-framework/KIF.git", :tag => "v#{ s.version.to_s }" }
s.platform = :ios, '10.0'
s.platform = :ios, '11.0'
s.frameworks = 'CoreGraphics', 'QuartzCore', 'IOKit', 'WebKit', 'XCTest'
s.default_subspec = 'Core'
s.requires_arc = true
Expand Down
6 changes: 3 additions & 3 deletions KIF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = YES;
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1834,7 +1834,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -2097,7 +2097,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let package = Package(
name: "KIF",
platforms: [
.iOS(.v9)
.iOS(.v11)
],
products: [
.library(
Expand Down
6 changes: 3 additions & 3 deletions Test Host/Base.lproj/MainStoryboard.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="3">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="3">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -317,7 +317,7 @@
<rect key="frame" x="0.0" y="0.0" width="383.5" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="UIActionSheet" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Iob-Ej-M2H">
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="UIAlertController" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Iob-Ej-M2H">
<rect key="frame" x="20" y="0.0" width="355.5" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
Expand Down
39 changes: 34 additions & 5 deletions Test Host/TestSuiteViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <UIKit/UIKit.h>

@interface TestSuiteViewController : UITableViewController <UIActionSheetDelegate>
@interface TestSuiteViewController : UITableViewController
@end

@implementation TestSuiteViewController
Expand Down Expand Up @@ -70,7 +70,31 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

case 2:
{
[[[UIActionSheet alloc] initWithTitle:@"Action Sheet" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destroy" otherButtonTitles:@"A", @"B", nil] showInView:tableView];
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:@"Alert Controller"
message:@""
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *destroyAction = [UIAlertAction actionWithTitle:@"Destroy" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[self alertControllerDismissed];
}];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[self alertControllerDismissed];
}];

[alertController addAction:destroyAction];
[alertController addAction:[self alertActionWithTitle:@"A"]];
[alertController addAction:[self alertActionWithTitle:@"B"]];
[alertController addAction:cancelAction];

if ([alertController respondsToSelector:@selector(popoverPresentationController)] && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// iOS 8 iPad presents in a popover
alertController.popoverPresentationController.sourceView = [tableView cellForRowAtIndexPath:indexPath];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:alertController];
[popover presentPopoverFromRect:alertController.popoverPresentationController.sourceView.frame inView:tableView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
} else {
[self presentViewController:alertController animated:YES completion:nil];
}
break;
}

Expand Down Expand Up @@ -103,9 +127,7 @@ -(void)pullToRefreshHandler
});
}

#pragma mark - UIActionSheetDelegate

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
- (void)alertControllerDismissed
{
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"Alert View"
message:@"Message"
Expand All @@ -115,6 +137,13 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
[self presentViewController:alertController animated:YES completion:nil];
}

-(UIAlertAction *)alertActionWithTitle:(NSString *)title
{
return [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self alertControllerDismissed];
}];
}

- (IBAction)resetRefreshControl
{
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Refreshing...", @"") attributes:nil];
Expand Down