Commit c9b3e283 by Brent Gulanowski

Add nullability specificiers.

parent 5801c8bc
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
@import UIKit; @import UIKit;
#import "BUYPaymentProvider.h" #import "BUYPaymentProvider.h"
extern NSString *const _Nonnull BUYApplePayPaymentProviderId; NS_ASSUME_NONNULL_BEGIN
extern NSString *const BUYApplePayPaymentProviderId;
@class BUYClient; @class BUYClient;
...@@ -41,20 +43,20 @@ extern NSString *const _Nonnull BUYApplePayPaymentProviderId; ...@@ -41,20 +43,20 @@ extern NSString *const _Nonnull BUYApplePayPaymentProviderId;
* *
* @return an instance of `BUYApplePayPaymentProvider` * @return an instance of `BUYApplePayPaymentProvider`
*/ */
- (instancetype _Nullable)initWithClient:(BUYClient * _Nonnull)client merchantID:(NSString * _Nonnull)merchantID NS_DESIGNATED_INITIALIZER; - (instancetype)initWithClient:(BUYClient *)client merchantID:(NSString *)merchantID NS_DESIGNATED_INITIALIZER;
- (instancetype _Nullable)init NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE;
/** /**
* The supported credit card payment networks. Default values: * The supported credit card payment networks. Default values:
* iOS 8.3: PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa. * iOS 8.3: PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa.
* iOS 9.0: PKPaymentNetworkAmex, PKPaymentNetworkDiscover, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa. * iOS 9.0: PKPaymentNetworkAmex, PKPaymentNetworkDiscover, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa.
*/ */
@property (nonatomic, copy) NSArray * _Nonnull supportedNetworks; @property (nonatomic, copy) NSArray * supportedNetworks;
/** /**
* The merchant ID required for Apple Pay * The merchant ID required for Apple Pay
*/ */
@property (nonatomic, copy, readonly) NSString * _Nonnull merchantID; @property (nonatomic, copy, readonly) NSString * merchantID;
/** /**
* If the merchantId is set and the device support Apple Pay but no credit card is present this allows the user to add a payment pass to the Wallet. * If the merchantId is set and the device support Apple Pay but no credit card is present this allows the user to add a payment pass to the Wallet.
...@@ -73,3 +75,5 @@ extern NSString *const _Nonnull BUYApplePayPaymentProviderId; ...@@ -73,3 +75,5 @@ extern NSString *const _Nonnull BUYApplePayPaymentProviderId;
- (BOOL)canShowApplePaySetup; - (BOOL)canShowApplePaySetup;
@end @end
NS_ASSUME_NONNULL_END
...@@ -26,8 +26,12 @@ ...@@ -26,8 +26,12 @@
#import <Buy/Buy.h> #import <Buy/Buy.h>
NS_ASSUME_NONNULL_BEGIN
@interface BUYClient (Checkout) @interface BUYClient (Checkout)
- (NSURLSessionDataTask *)handleCheckout:(BUYCheckout *)checkout completion:(BUYDataCheckoutBlock)completion; - (NSURLSessionDataTask *)handleCheckout:(BUYCheckout *)checkout completion:(BUYDataCheckoutBlock)completion;
@end @end
NS_ASSUME_NONNULL_END
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
@import Foundation; @import Foundation;
#import "BUYPaymentProvider.h" #import "BUYPaymentProvider.h"
NS_ASSUME_NONNULL_BEGIN
@interface BUYPaymentController : NSObject @interface BUYPaymentController : NSObject
/** /**
...@@ -50,7 +52,7 @@ ...@@ -50,7 +52,7 @@
* *
* @return The payment provider matching the given identifier * @return The payment provider matching the given identifier
*/ */
- (id <BUYPaymentProvider>)providerForType:(NSString *)type; - (id <BUYPaymentProvider> _Nullable)providerForType:(NSString *)type;
/** /**
* Start a checkout * Start a checkout
...@@ -61,3 +63,5 @@ ...@@ -61,3 +63,5 @@
- (void)startCheckout:(BUYCheckout *)checkout withProviderType:(NSString *)typeIdentifier; - (void)startCheckout:(BUYCheckout *)checkout withProviderType:(NSString *)typeIdentifier;
@end @end
NS_ASSUME_NONNULL_END
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#import "BUYClient.h" #import "BUYClient.h"
NS_ASSUME_NONNULL_BEGIN
@class BUYCheckout; @class BUYCheckout;
@protocol BUYPaymentProvider; @protocol BUYPaymentProvider;
...@@ -86,7 +88,7 @@ extern NSString *const BUYPaymentProviderDidCompleteCheckoutNotificationKey; ...@@ -86,7 +88,7 @@ extern NSString *const BUYPaymentProviderDidCompleteCheckoutNotificationKey;
* @param provider the `BUYPaymentProvider` * @param provider the `BUYPaymentProvider`
* @param error the optional `NSError` * @param error the optional `NSError`
*/ */
- (void)paymentProvider:(id <BUYPaymentProvider>)provider didFailCheckoutWithError:(NSError *)error; - (void)paymentProvider:(id <BUYPaymentProvider>)provider didFailCheckoutWithError:(NSError * _Nullable)error;
/** /**
* Called when the checkout has completed * Called when the checkout has completed
...@@ -139,3 +141,5 @@ extern NSString *const BUYPaymentProviderDidCompleteCheckoutNotificationKey; ...@@ -139,3 +141,5 @@ extern NSString *const BUYPaymentProviderDidCompleteCheckoutNotificationKey;
@property (nonatomic, weak) id <BUYPaymentProviderDelegate> delegate; @property (nonatomic, weak) id <BUYPaymentProviderDelegate> delegate;
@end @end
NS_ASSUME_NONNULL_END
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "BUYPaymentProvider.h" #import "BUYPaymentProvider.h"
extern NSString * _Nonnull BUYSafariCallbackURLNotification; NS_ASSUME_NONNULL_BEGIN
extern NSString * _Nonnull BUYURLKey;
extern NSString * _Nonnull const BUYWebPaymentProviderId; extern NSString * BUYSafariCallbackURLNotification;
extern NSString * BUYURLKey;
extern NSString * const BUYWebPaymentProviderId;
@interface BUYWebCheckoutPaymentProvider : NSObject <BUYPaymentProvider> @interface BUYWebCheckoutPaymentProvider : NSObject <BUYPaymentProvider>
...@@ -40,7 +42,9 @@ extern NSString * _Nonnull const BUYWebPaymentProviderId; ...@@ -40,7 +42,9 @@ extern NSString * _Nonnull const BUYWebPaymentProviderId;
* *
* @return an instance of `BUYWebCheckoutPaymentProvider` * @return an instance of `BUYWebCheckoutPaymentProvider`
*/ */
- (instancetype _Nullable)initWithClient:(BUYClient * _Nonnull)client NS_DESIGNATED_INITIALIZER; - (instancetype)initWithClient:(BUYClient *)client NS_DESIGNATED_INITIALIZER;
- (instancetype _Nullable)init NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE;
@end @end
NS_ASSUME_NONNULL_END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment