Compare commits

...

13 Commits

Author SHA1 Message Date
Max Howell
0808da4cf0 Tag 3.5.3 2016-12-07 14:12:10 -05:00
Max Howell
205a3dd150 Fix tests 2016-12-07 14:12:10 -05:00
Max Howell
16d6889f59 Fix OHHTTPStubs build on Travis 2016-12-07 14:12:10 -05:00
Max Howell
d3d4dda765 Rename UIViewController.Error; Fixes #598 2016-12-07 14:12:10 -05:00
Max Howell
a92ed7e31f Merge pull request #597 from zayhero/zayhero__add_import_AnyPromise_Private
add AnyPromise+Private.h import into PMKCallVariadicBlock.m
2016-12-07 12:41:51 -05:00
brian_zhang
0d0ea895c7 add AnyPromise+Private.h import into PMKCallVariadicBlock.m 2016-12-01 10:56:17 -08:00
Max Howell
3982576003 Attempt to fix Travis 2016-11-19 13:09:06 -05:00
Max Howell
6cecb1b94f CocoaPods 1.1 fixes 2016-11-10 21:22:40 -05:00
Max Howell
8e2edca821 Tag 3.5.2 2016-11-10 20:08:56 -05:00
Max Howell
ab0cac391f Move Error to root level; Fixes #552 2016-11-10 20:08:26 -05:00
Max Howell
46e227bcb2 Merge pull request #585 from allen-zeng/xcode81-watchos-deployment-target
explicitly set watchOS deployment target to match the podspec
2016-11-10 16:43:45 -05:00
Allen Zeng
cc503ae873 explicitly set watchOS deployment target to match the podspec 2016-11-08 19:00:49 +11:00
Max Howell
de740a37f5 Attempt to build with two OS X images 2016-09-07 18:25:20 -07:00
10 changed files with 34 additions and 38 deletions

View File

@ -2,11 +2,11 @@ language: objective-c
xcode_project: PromiseKit.xcodeproj
xcode_scheme: [PMKiOS, PMKOSX]
xcode_sdk: [iphonesimulator9.3, macosx10.11]
osx_image: xcode7.3
osx_image: xcode8
install:
- "gem install travis-xcodebuild"
- "carthage bootstrap --platform Mac,iOS"
- "TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage bootstrap --platform Mac,iOS --no-use-binaries"
script:
- travis-xcodebuild
@ -18,12 +18,5 @@ matrix:
- xcode_scheme: PMKiOS
xcode_sdk: macosx10.11
branches:
only:
- master
- swift-2.2-minimal-changes
- swift-2.0-minimal-changes
- legacy-1.x
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -31,14 +31,14 @@ extension UIActionSheet {
return proxy.promise
}
}
public enum Error: CancellableErrorType {
case Cancelled
public enum UIActionSheetError: CancellableErrorType {
case Cancelled
public var cancelled: Bool {
switch self {
case .Cancelled: return true
}
public var cancelled: Bool {
switch self {
case .Cancelled: return true
}
}
}
@ -53,7 +53,7 @@ private class PMKActionSheetDelegate: NSObject, UIActionSheetDelegate {
if buttonIndex != actionSheet.cancelButtonIndex {
fulfill(buttonIndex)
} else {
reject(UIActionSheet.Error.Cancelled)
reject(UIActionSheetError.Cancelled)
}
}
}

View File

@ -32,14 +32,14 @@ extension UIAlertView {
return proxy.promise
}
}
public enum Error: CancellableErrorType {
case Cancelled
public enum UIAlertViewError: CancellableErrorType {
case Cancelled
public var cancelled: Bool {
switch self {
case .Cancelled: return true
}
public var cancelled: Bool {
switch self {
case .Cancelled: return true
}
}
}
@ -52,7 +52,7 @@ private class PMKAlertViewDelegate: NSObject, UIAlertViewDelegate {
if buttonIndex != alertView.cancelButtonIndex {
fulfill(buttonIndex)
} else {
reject(UIAlertView.Error.Cancelled)
reject(UIAlertViewError.Cancelled)
}
}
}

View File

@ -21,7 +21,7 @@ import PromiseKit
*/
extension UIViewController {
public enum Error: ErrorType {
public enum PMKError: ErrorType {
case NavigationControllerEmpty
case NoImageFound
case NotPromisable
@ -45,7 +45,7 @@ extension UIViewController {
switch vc {
case let nc as UINavigationController:
guard let vc = nc.viewControllers.first else { return Promise(error: Error.NavigationControllerEmpty) }
guard let vc = nc.viewControllers.first else { return Promise(error: PMKError.NavigationControllerEmpty) }
pvc = vc
default:
pvc = vc
@ -54,13 +54,13 @@ extension UIViewController {
let promise: Promise<T>
if !pvc.conformsToProtocol(Promisable) {
promise = Promise(error: UIViewController.Error.NotPromisable)
promise = Promise(error: PMKError.NotPromisable)
} else if let p = pvc.valueForKeyPath("promise") as? Promise<T> {
promise = p
} else if let _: AnyObject = pvc.valueForKeyPath("promise") {
promise = Promise(error: UIViewController.Error.NotGenericallyPromisable)
promise = Promise(error: PMKError.NotGenericallyPromisable)
} else {
promise = Promise(error: UIViewController.Error.NilPromisable)
promise = Promise(error: PMKError.NilPromisable)
}
if !promise.pending {
@ -105,7 +105,7 @@ extension UIViewController {
if let img = info[UIImagePickerControllerOriginalImage] as? UIImage {
return img
}
throw Error.NoImageFound
throw PMKError.NoImageFound
}.always {
vc.presentingViewController?.dismissViewControllerAnimated(animated, completion: nil)
}

View File

@ -140,7 +140,7 @@ Pod::Spec.new do |s|
ss.ios.source_files = 'Categories/Social/*'
ss.osx.source_files = Dir['Categories/Social/*'] - ['Categories/Social/SLComposeViewController+Promise.swift']
ss.dependency 'PromiseKit/CorePromise'
ss.frameworks = 'Social'
ss.ios.frameworks = ss.osx.frameworks = 'Social'
end
s.subspec 'StoreKit' do |ss|

View File

@ -2191,6 +2191,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Debug;
};
@ -2213,6 +2214,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Release;
};
@ -2273,7 +2275,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.5.1;
CURRENT_PROJECT_VERSION = 3.5.3;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@ -2328,7 +2330,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 3.5.1;
CURRENT_PROJECT_VERSION = 3.5.3;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;

View File

@ -2,6 +2,7 @@
#import <Foundation/NSDictionary.h>
#import <Foundation/NSError.h>
#import <Foundation/NSException.h>
#import "AnyPromise+Private.h"
#import "NSMethodSignatureForBlock.m"
#import <PromiseKit/Umbrella.h>
#import <PromiseKit/PromiseKit.h>

View File

@ -30,8 +30,8 @@ class Test_UIActionSheet_Swift: UIKitTestCase {
sheet.addButtonWithTitle("1")
sheet.cancelButtonIndex = sheet.addButtonWithTitle("2")
sheet.promiseInView(rootvc.view).error(policy: .AllErrors) { err in
guard let err = err as? UIActionSheet.Error else { return XCTFail() }
XCTAssertTrue(err == UIActionSheet.Error.Cancelled)
guard let err = err as? UIActionSheetError else { return XCTFail() }
XCTAssertTrue(err == UIActionSheetError.Cancelled)
XCTAssertTrue(err.cancelled)
ex.fulfill()
}

View File

@ -30,7 +30,7 @@ class Test_UIAlertView_Swift: UIKitTestCase {
alert.addButtonWithTitle("1")
alert.cancelButtonIndex = alert.addButtonWithTitle("2")
alert.promise().error(policy: .AllErrors) { err in
guard let err = err as? UIAlertView.Error else { return XCTFail() }
guard let err = err as? UIAlertViewError else { return XCTFail() }
XCTAssertTrue(err == .Cancelled)
XCTAssertTrue(err.cancelled)
ex.fulfill()

View File

@ -11,7 +11,7 @@ class Test_UIViewController_Swift: UIKitTestCase {
let ex = expectationWithDescription("")
let p: Promise<Int> = rootvc.promiseViewController(UIViewController(), animate: [])
p.error { error in
if case UIViewController.Error.NotPromisable = error {
if case UIViewController.PMKError.NotPromisable = error {
ex.fulfill()
}
}
@ -22,7 +22,7 @@ class Test_UIViewController_Swift: UIKitTestCase {
let ex = expectationWithDescription("")
let p: Promise<Int> = rootvc.promiseViewController(MockViewController(), animate: [])
p.error { error in
if case UIViewController.Error.NilPromisable = error {
if case UIViewController.PMKError.NilPromisable = error {
ex.fulfill()
}
}
@ -35,7 +35,7 @@ class Test_UIViewController_Swift: UIKitTestCase {
my.promise = Promise(true)
let p: Promise<Int> = rootvc.promiseViewController(my, animate: [])
p.error { err in
if case UIViewController.Error.NotGenericallyPromisable = err {
if case UIViewController.PMKError.NotGenericallyPromisable = err {
ex.fulfill()
}
}