Skip to content

Commit 7147281

Browse files
committed
Merge branch 'master' into carthage-support
2 parents 336daff + 6bf7d4f commit 7147281

File tree

6 files changed

+48
-8
lines changed

6 files changed

+48
-8
lines changed

Carthage/Checkouts/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#import <Foundation/NSURLResponse.h>
1111
#import "NSURLConnection+AnyPromise.h"
1212
#import <PromiseKit/PromiseKit.h>
13+
// When using Carthage add `github "mxcl/OMGHTTPURLRQ"` to your Cartfile.
1314
#import <OMGHTTPURLRQ/OMGHTTPURLRQ.h>
1415
#import <OMGHTTPURLRQ/OMGUserAgent.h>
1516

Carthage/Checkouts/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ + (instancetype)delegateWithPromise:(AnyPromise **)promise;
1313

1414
@implementation UIViewController (PromiseKit)
1515

16-
- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block
17-
{
18-
id vc2present = vc;
16+
- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block {
17+
__kindof UIViewController *vc2present = vc;
1918
AnyPromise *promise = nil;
2019

2120
if ([vc isKindOfClass:NSClassFromString(@"MFMailComposeViewController")]) {
@@ -72,8 +71,7 @@ - (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)anim
7271
[self presentViewController:vc2present animated:animated completion:block];
7372

7473
promise.finally(^{
75-
//TODO can we be more specific?
76-
[self dismissViewControllerAnimated:animated completion:nil];
74+
[vc2present.presentingViewController dismissViewControllerAnimated:animated completion:nil];
7775
});
7876

7977
return promise;

Carthage/Checkouts/PromiseKit/README.markdown

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,36 @@ when(fetchImage(), getLocation()).then { image, location in
1818
PromiseKit is a thoughtful and complete implementation of promises for iOS and OS X with first-class support for **both** Objective-C *and* Swift.
1919

2020
[![Join the chat at https://gitter.im/mxcl/PromiseKit](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mxcl/PromiseKit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![](https://img.shields.io/cocoapods/v/PromiseKit.svg?label=Current%20Release) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)
21-
21+
[![codebeat](https://codebeat.co/badges/6a2fc7b4-cc8f-4865-a81d-644edd38c662)](https://codebeat.co/projects/github-com-mxcl-promisekit)
2222

2323
# Swift 2
2424

25+
2526
The `swift-2.0-beta` branch has a working Swift 2 implementation. Please be aware that both `catch` and `defer` are Swift 2 keywords so we have had to rename these functions and our new choices are not yet final.
2627

2728

29+
If you are writing a library, [**use PromiseKit 1.x**](https://github.com/mxcl/PromiseKit/tree/legacy-1.x). This is because PromiseKit > 2 breaks everytime Swift changes. While Swift is in flux it is not feasible to depend on a library that will break every time Xcode updates.
30+
31+
If you are making an app then PromiseKit 3 is the best PromiseKit, you may have to make some fixes when Xcode updates, but probably you will be OK as long as you update PromiseKit when Xcode updates.
32+
33+
PromiseKit 1 and 3 can be installed in parallel if necessary, but CocoaPods will not support this.
34+
35+
Once Swift becomes ABI or API stable we can all just move to the latest PromiseKit.
36+
37+
Thus we intend to support PromiseKit 1.x for longer than expected.
38+
39+
40+
# PromiseKit 3
41+
42+
In Swift 2.0 `catch` and `defer` became reserved keywords mandating we rename our functions with these names. This forced a major semantic version change on PromiseKit and thus we took the opportunity to make other minor (source compatability breaking) improvements.
43+
44+
Thus if you cannot afford to adapt to PromiseKit 3 but still want to use Xcode-7.0/Swift-2.0 we provide a [minimal changes branch] \(Swift 2.2 version [here](https://github.com/mxcl/PromiseKit/tree/swift-2.2-minimal-changes)\) where `catch` and `defer` are renamed `catch_` and `defer_` and all other changes are the bare minimum to make PromiseKit 2 compile against Swift 2.
45+
46+
If you still are using Xcode 6 and Swift 1.2 then use PromiseKit 2.
47+
48+
[minimal changes branch]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes
49+
>>>>>>> master:Example/Pods/PromiseKit/README.markdown
50+
2851
# PromiseKit 2
2952

3053
PromiseKit 2 contains many interesting and important additions. Check out our our [release announcement](http://promisekit.org/PromiseKit-2.0-Released/) for full details.
@@ -61,13 +84,18 @@ github "mxcl/PromiseKit" ~> 2.0
6184

6285
Neither CocoaPods or Carthage will install PromiseKit 2 for an iOS 7 target. Your options are:
6386

64-
1. `pod "PromiseKit", "~> 1.5"` †‡
87+
1. `pod "PromiseKit", "~> 1.7"` †‡
6588
2. Use our [iOS 7 EZ-Bake](https://github.com/PromiseKit/EZiOS7)
6689
3. Download our pre-built static framework (coming soon!)
6790

6891
† There is no Swift support with PromiseKit 1.x installed via CocoaPods.<br>‡ PromiseKit 1.x will work as far back as iOS 5 if required.
6992

7093

94+
# Support
95+
96+
PromiseKit is lucky enough to have a large community behind it which is reflected in our [Gitter chat](https://gitter.im/mxcl/PromiseKit). If you're new to PromiseKit and are stumped or otherwise have a question that doesn't feel like an issue (and isn't answered in our [documentation](http://promisekit.org/introduction)) then our Gitter is a great place to go for help. Of course if you're onto something that you believe is broken or could be improved then opening a new issue is still the way to go 👍.
97+
98+
7199
# Donations
72100

73101
PromiseKit is hundreds of hours of work almost completely by just me: [Max Howell](https://twitter.com/mxcl). I thoroughly enjoyed making PromiseKit, but nevertheless if you have found it useful then your bitcoin will give me a warm fuzzy feeling from my head right down to my toes: 1JDbV5zuym3jFw4kBCc5Z758maUD8e4dKR.

Carthage/Checkouts/PromiseKit/Sources/AnyPromise.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) {
1010
PMKCatchPolicyAllErrorsExceptCancellation
1111
};
1212

13+
/**
14+
This block lets you override the default dispatch queue for Promises.
15+
16+
By default this returns dispatch_get_main_queue()
17+
*/
18+
extern __nonnull dispatch_queue_t (^__nonnull PMKDefaultDispatchQueue)();
1319

1420
/**
1521
@see AnyPromise.swift

Carthage/Checkouts/PromiseKit/Sources/PromiseKit.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
#import <dispatch/queue.h>
1+
#if defined(__cplusplus)
2+
#import <dispatch/dispatch.h>
3+
#else
4+
#import <dispatch/queue.h>
5+
#endif
26
#import <Foundation/NSDate.h>
37
#import <Foundation/NSObject.h>
48
#import <PromiseKit/AnyPromise.h>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ PokemonKit.fetchBerry("1")
2929
- [x] Wrap all API end points
3030
- [x] Fully [Documented](http://continuouslearning.github.io/PokemonKit/)
3131
- [ ] Fully tested
32+
- [ ] Carthage Support
33+
- [ ] Unit test don't call server
34+
- [ ] Remove PromiseKit (So many build errors, not worth it)
3235

3336
## Installation
3437

0 commit comments

Comments
 (0)