Skip to content

Commit

Permalink
Add deprecations for old constants
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed May 23, 2014
1 parent 0a2905a commit 7dfc697
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions PromiseKit+Foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#define PMKURLErrorFailingURLResponseKey @"PMKURLErrorFailingURLResponseKey"
#define PMKURLErrorFailingDataKey @"PMKURLErrorFailingDataKey"

extern NSString const*const PMKURLErrorFailingURLResponse __attribute__((deprecated("Use PMKURLErrorFailingURLResponseKey")));
extern NSString const*const PMKURLErrorFailingData __attribute__((deprecated("Use PMKURLErrorFailingDataKey")));



@interface NSURLConnection (PromiseKit)
+ (Promise *)GET:(id)stringFormatOrNSURL, ...;
Expand Down
4 changes: 4 additions & 0 deletions PromiseKit+Foundation.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#import "PromiseKit+Foundation.h"
#import "PromiseKit/Promise.h"

NSString const*const PMKURLErrorFailingURLResponse = PMKURLErrorFailingURLResponseKey;
NSString const*const PMKURLErrorFailingData = PMKURLErrorFailingDataKey;



static inline NSString *enc(NSString *in) {
return (__bridge_transfer NSString *) CFURLCreateStringByAddingPercentEscapes(
Expand Down
3 changes: 3 additions & 0 deletions PromiseKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
@interface PMKArray : NSObject
@end

// deprecated
NSString const*const PMKThrown = PMKUnderlyingExceptionKey;



static inline NSError *NSErrorWithThrown(id e) {
Expand Down
3 changes: 2 additions & 1 deletion PromiseKit/Promise.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@import Foundation.NSError;


typedef void (^PromiseResolver)(id) __attribute__((deprecated));
typedef void (^PromiseResolver)(id) __attribute__((deprecated("Use PromiseFulfiller or PromiseRejecter")));
typedef void (^PromiseFulfiller)(id);
typedef void (^PromiseRejecter)(NSError *);

Expand Down Expand Up @@ -134,6 +134,7 @@ id PMKManifold(NSArray *arguments);
#define PMKErrorCodeUnknown 2
#define PMKErrorCodeInvalidUsage 3

extern NSString const*const PMKThrown __attribute__((deprecated("Use PMKUnderlyingExceptionKey")));


/**
Expand Down

0 comments on commit 7dfc697

Please sign in to comment.