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

Xcode13-beta3 Fix #345

Merged
merged 8 commits into from
Jul 26, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"package": "braintree_ios",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This Package.resolved is for the Demo app.

"repositoryURL": "https://github.com/braintree/braintree_ios",
"state": {
"branch": null,
"revision": "6be5b6ceabe6acf3353a986da272bc604c8cd010",
"version": "5.4.2"
"branch": "master",
"revision": "ca0cbc19dc767ae5f1c757101437cd7c1e482976",
"version": null
}
},
{
"package": "InAppSettingsKit",
"repositoryURL": "https://github.com/futuretap/InAppSettingsKit.git",
"state": {
"branch": null,
"revision": "e4985e0dc0de36f12801f67cc984b3d1cb7f3d52",
"version": "3.3.1"
"revision": "71e03ebad8462618f96c575c86d2e9220f880676",
"version": "3.3.2"
}
}
]
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## unreleased
* Add `deviceData` to `BTDropInResult`
* Require `braintree_ios` 5.4.3 or higher (includes Xcode 13-beta3 fixes)
* Swift Package Manager
* Adds `NS_EXTENSION_UNAVAILABLE` annotations to methods unavailable for use in app extensions (fixes #343 for Xcode 13-beta3)
scannillo marked this conversation as resolved.
Show resolved Hide resolved

## 9.1.0 (2021-07-01)
* Increase valid Discover card length to 19 digits
Expand Down
2 changes: 1 addition & 1 deletion Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
repositoryURL = "https://github.com/futuretap/InAppSettingsKit.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.1.8;
minimumVersion = 3.0.0;
};
};
8021E365268A1CB4003BBA53 /* XCRemoteSwiftPackageReference "braintree-ios-drop-in" */ = {
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
)
],
dependencies: [
.package(name: "Braintree", url: "https://github.com/braintree/braintree_ios", from: "5.4.2")
.package(name: "Braintree", url: "https://github.com/braintree/braintree_ios", from: "5.4.3")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
4 changes: 2 additions & 2 deletions Sources/BraintreeDropIn/BTPaymentSelectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ - (void)configurationLoaded:(__unused BTConfiguration *)configuration error:(NSE

#pragma mark - Accessors

- (id)application {
- (id)application NS_EXTENSION_UNAVAILABLE("Uses APIs (i.e UIApplication.sharedApplication) not available for use in App Extensions.") {
if (!_application) {
_application = [UIApplication sharedApplication];
_application = UIApplication.sharedApplication;
}
return _application;
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/BraintreeDropIn/BTVaultManagementViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void)configurationLoaded:(__unused BTConfiguration *)configuration error:(NSE
}
}

- (void)fetchPaymentMethodsOnCompletion:(void(^)(void))completionBlock {
- (void)fetchPaymentMethodsOnCompletion:(void(^)(void))completionBlock NS_EXTENSION_UNAVAILABLE("Uses APIs (i.e UIApplication.sharedApplication) not available for use in App Extensions.") {
if (!self.apiClient.clientToken) {
self.paymentMethodNonces = @[];
if (completionBlock) {
Expand All @@ -93,10 +93,10 @@ - (void)fetchPaymentMethodsOnCompletion:(void(^)(void))completionBlock {
return;
}

[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:YES];

[self.apiClient fetchPaymentMethodNonces:YES completion:^(NSArray<BTPaymentMethodNonce *> *paymentMethodNonces, NSError *error) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:NO];

if (error) {
// no action
Expand Down
10 changes: 5 additions & 5 deletions Sources/BraintreeDropIn/Helpers/BTUIKViewUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ + (BTUIKVectorArtView *)vectorArtViewForVisualAssetType:(BTUIKVisualAssetType)ty
}
}

+ (BOOL)isLanguageLayoutDirectionRightToLeft {
return [UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
+ (BOOL)isLanguageLayoutDirectionRightToLeft NS_EXTENSION_UNAVAILABLE("Uses APIs (i.e UIApplication.sharedApplication) not available for use in App Extensions.") {
return UIApplication.sharedApplication.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
}

+ (NSTextAlignment)naturalTextAlignment {
Expand All @@ -246,7 +246,7 @@ + (NSTextAlignment)naturalTextAlignmentInverse {
return [self isLanguageLayoutDirectionRightToLeft] ? NSTextAlignmentLeft : NSTextAlignmentRight;
}

+ (UIWindowScene *)activeWindowScene API_AVAILABLE(ios(13.0)) {
+ (UIWindowScene *)activeWindowScene API_AVAILABLE(ios(13.0)) NS_EXTENSION_UNAVAILABLE("Uses APIs (i.e UIApplication.sharedApplication) not available for use in App Extensions.") {
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
if (scene.activationState == UISceneActivationStateForegroundActive) {
return (UIWindowScene *)scene;
Expand All @@ -256,15 +256,15 @@ + (UIWindowScene *)activeWindowScene API_AVAILABLE(ios(13.0)) {
return nil;
}

+ (BOOL)isOrientationLandscape {
+ (BOOL)isOrientationLandscape NS_EXTENSION_UNAVAILABLE("Uses APIs (i.e UIApplication.sharedApplication) not available for use in App Extensions.") {
if (@available(iOS 13, *)) {
return UIInterfaceOrientationIsLandscape([self activeWindowScene].interfaceOrientation);
} else {
return UIInterfaceOrientationIsLandscape(UIApplication.sharedApplication.statusBarOrientation);
}
}

+ (CGFloat)statusBarHeight {
+ (CGFloat)statusBarHeight NS_EXTENSION_UNAVAILABLE("Uses APIs (i.e UIApplication.sharedApplication) not available for use in App Extensions.") {
if (@available(iOS 13, *)) {
return CGRectGetHeight([self activeWindowScene].statusBarManager.statusBarFrame);
} else {
Expand Down