Skip to content

Commit

Permalink
Drop Xcode 14 (stripe#3399)
Browse files Browse the repository at this point in the history
## Summary
<!-- Simple summary of what was changed. -->

## Motivation
https://jira.corp.stripe.com/browse/MOBILESDK-1810

## Testing
CI

## Changelog
See diff
  • Loading branch information
porter-stripe authored Mar 13, 2024
1 parent 8d482a9 commit 8c1ba23
Show file tree
Hide file tree
Showing 30 changed files with 168 additions and 219 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## X.X.X
### All
* Xcode 14 is [no longer supported by Apple](https://developer.apple.com/news/upcoming-requirements/). Please upgrade to Xcode 15 or later.

## 23.25.0 2024-03-11
### CustomerSheet
* [Added] Added `paymentMethodTypes` in `CustomerAdapter` to control what payment methods are displayed.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ If you're reading this on GitHub.com, please make sure you are looking at the [t

## Requirements

The Stripe iOS SDK requires Xcode 14.1 or later and is compatible with apps targeting iOS 13 or above. We support Catalyst on macOS 11 or later.
The Stripe iOS SDK requires Xcode 15 or later and is compatible with apps targeting iOS 13 or above. We support Catalyst on macOS 11 or later.

For iOS 12 support, please use [v22.8.4](https://github.com/stripe/stripe-ios/tree/v22.8.4). For iOS 11 support, please use [v21.13.0](https://github.com/stripe/stripe-ios/tree/v21.13.0). For iOS 10, please use [v19.4.0](https://github.com/stripe/stripe-ios/tree/v19.4.0). If you need to support iOS 9, use [v17.0.2](https://github.com/stripe/stripe-ios/tree/v17.0.2).

Expand Down
2 changes: 1 addition & 1 deletion Stripe.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '13.0'
s.weak_framework = 'SwiftUI'
s.source_files = 'Stripe/StripeiOS/Source/*.swift'
s.ios.resource_bundle = { 'Stripe' => 'Stripe/StripeiOS/Resources/**/*.{lproj,png,xcassets}' }
s.ios.resource_bundle = { 'StripeBundle' => 'Stripe/StripeiOS/Resources/**/*.{lproj,png,xcassets}' }
s.dependency 'StripeCore', s.version.to_s
s.dependency 'StripeUICore', s.version.to_s
s.dependency 'StripeApplePay', s.version.to_s
Expand Down
2 changes: 1 addition & 1 deletion Stripe/StripeiOS/Source/StripeBundleLocator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
/// :nodoc:
@_spi(STP) public final class StripeBundleLocator: BundleLocatorProtocol {
public static let internalClass: AnyClass = StripeBundleLocator.self
public static let bundleName = "Stripe"
public static let bundleName = "StripeBundle"
#if SWIFT_PACKAGE
public static let spmResourcesBundle = Bundle.module
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,7 @@ public class STPApplePayContext: NSObject, PKPaymentAuthorizationControllerDeleg
@available(macCatalystApplicationExtension, unavailable)
@objc(presentApplePayWithCompletion:)
public func presentApplePay(completion: STPVoidBlock? = nil) {
// A note on `canImport(CompositorServices)`, found here and elsewhere
// in the codebase: This is a terrible, terrible hack.
// We should use #if os(visionOS), but that will fail to compile
// on Xcode 14. Because we need to continue supporting both Xcode 14
// *and* building on visionOS, we instead check `canImport(CompositerServices)`, as CompositerServices currently
// only exists on visionOS. I'm sure it will exist on iOS someday,
// but we only need this in place until we drop Xcode 14.
//
// Future engineers in May 2024: Please delete this! Find every mention
// of canImport(CompositorServices) and replace it with os(visionOS).
#if canImport(CompositorServices)
#if os(visionOS)
// This isn't great: We should encourage the use of presentApplePay(from window:) instead.
let windows = UIApplication.shared.connectedScenes
.compactMap { ($0 as? UIWindowScene)?.windows }
Expand Down Expand Up @@ -265,26 +255,14 @@ public class STPApplePayContext: NSObject, PKPaymentAuthorizationControllerDeleg

// MARK: - Private Helper
func _delegateToAppleDelegateMapping() -> [Selector: Selector] {
// We need this type to disambiguate from the other PKACDelegate.didSelect:handler: method
// HACK: This signature changed in Xcode 14, we need to check the compiler version to choose the right signature.
#if compiler(>=5.7)
typealias pkDidSelectShippingMethodSignature =
(any PKPaymentAuthorizationControllerDelegate) -> (
(
PKPaymentAuthorizationController,
PKShippingMethod,
@escaping (PKPaymentRequestShippingMethodUpdate) -> Void
) -> Void
)?
#else
typealias pkDidSelectShippingMethodSignature = (
(PKPaymentAuthorizationControllerDelegate) -> (
PKPaymentAuthorizationController, PKShippingMethod,
typealias pkDidSelectShippingMethodSignature =
(any PKPaymentAuthorizationControllerDelegate) -> (
(
PKPaymentAuthorizationController,
PKShippingMethod,
@escaping (PKPaymentRequestShippingMethodUpdate) -> Void
) -> Void
)?
#endif

let pk_didSelectShippingMethod = #selector(
(PKPaymentAuthorizationControllerDelegate.paymentAuthorizationController(
_:
Expand Down
2 changes: 1 addition & 1 deletion StripeCardScan.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.weak_framework = 'AVKit', 'CoreML', 'VideoToolbox', 'Vision', 'AVFoundation'
s.source_files = 'StripeCardScan/StripeCardScan/**/*.swift'
s.ios.resource_bundle = { 'StripeCardScan' => 'StripeCardScan/StripeCardScan/Resources/**/*.{lproj,mlmodelc}' }
s.ios.resource_bundle = { 'StripeCardScanBundle' => 'StripeCardScan/StripeCardScan/Resources/**/*.{lproj,mlmodelc}' }
s.dependency 'StripeCore', "#{s.version}"
end
2 changes: 1 addition & 1 deletion StripeCardScan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This library can be used entirely outside of a Stripe integration and with other
## Requirements

- iOS 13.0 or higher
- XCode 14.1 or higher
- Xcode 15 or higher

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
/// :nodoc:
final class StripeCardScanBundleLocator: BundleLocatorProtocol {
static let internalClass: AnyClass = StripeCardScanBundleLocator.self
static let bundleName = "StripeCardScan"
static let bundleName = "StripeCardScanBundle"
#if SWIFT_PACKAGE
static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripeCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '13.0'
s.swift_version = '5.0'
s.source_files = 'StripeCore/StripeCore/**/*.swift'
s.ios.resource_bundle = { 'StripeCore' => 'StripeCore/StripeCore/Resources/**/*.lproj' }
s.ios.resource_bundle = { 'StripeCoreBundle' => 'StripeCore/StripeCore/Resources/**/*.lproj' }
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

final class StripeCoreBundleLocator: BundleLocatorProtocol {
static let internalClass: AnyClass = StripeCoreBundleLocator.self
static let bundleName = "StripeCore"
static let bundleName = "StripeCoreBundle"
#if SWIFT_PACKAGE
static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripeFinancialConnections.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Pod::Spec.new do |s|
s.dependency 'StripeCore', "#{s.version}"
s.dependency 'StripeUICore', "#{s.version}"
s.source_files = 'StripeFinancialConnections/StripeFinancialConnections/**/*.swift'
s.ios.resource_bundle = { 'StripeFinancialConnections' => 'StripeFinancialConnections/StripeFinancialConnections/Resources/**/*.{lproj,png}' }
s.ios.resource_bundle = { 'StripeFinancialConnectionsBundle' => 'StripeFinancialConnections/StripeFinancialConnections/Resources/**/*.{lproj,png}' }
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

final class StripeFinancialConnectionsBundleLocator: BundleLocatorProtocol {
static let internalClass: AnyClass = StripeFinancialConnectionsBundleLocator.self
static let bundleName = "StripeFinancialConnections"
static let bundleName = "StripeFinancialConnectionsBundle"
#if SWIFT_PACKAGE
static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripeIdentity.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.weak_framework = 'SwiftUI'
s.source_files = 'StripeIdentity/StripeIdentity/**/*.swift'
s.ios.resource_bundle = { 'StripeIdentity' => 'StripeIdentity/StripeIdentity/Resources/**/*.{lproj,json,png,xcassets}' }
s.ios.resource_bundle = { 'StripeIdentityBundle' => 'StripeIdentity/StripeIdentity/Resources/**/*.{lproj,json,png,xcassets}' }
s.dependency 'StripeCore', "#{s.version}"
s.dependency 'StripeUICore', "#{s.version}"
s.dependency 'StripeCameraCore', "#{s.version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation

@_spi(STP) public final class StripeIdentityBundleLocator: BundleLocatorProtocol {
@_spi(STP) public static let internalClass: AnyClass = StripeIdentityBundleLocator.self
@_spi(STP) public static let bundleName = "StripeIdentity"
@_spi(STP) public static let bundleName = "StripeIdentityBundle"
#if SWIFT_PACKAGE
@_spi(STP) public static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripePaymentSheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.weak_framework = 'SwiftUI'
s.source_files = 'StripePaymentSheet/StripePaymentSheet/Source/**/*.swift'
s.ios.resource_bundle = { 'StripePaymentSheet' => 'StripePaymentSheet/StripePaymentSheet/Resources/**/*.{lproj,png,xcassets,json}' }
s.ios.resource_bundle = { 'StripePaymentSheetBundle' => 'StripePaymentSheet/StripePaymentSheet/Resources/**/*.{lproj,png,xcassets,json}' }
s.dependency 'StripeCore', s.version.to_s
s.dependency 'StripePayments', s.version.to_s
s.dependency 'StripePaymentsUI', s.version.to_s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
/// :nodoc:
@_spi(STP) public final class StripePaymentSheetBundleLocator: BundleLocatorProtocol {
public static let internalClass: AnyClass = StripePaymentSheetBundleLocator.self
public static let bundleName = "StripePaymentSheet"
public static let bundleName = "StripePaymentSheetBundle"
#if SWIFT_PACKAGE
public static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripePayments.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.weak_framework = 'SwiftUI'
s.source_files = 'StripePayments/StripePayments/Source/**/*.swift'
s.ios.resource_bundle = { 'StripePayments' => 'StripePayments/StripePayments/Resources/**/*.{lproj}' }
s.ios.resource_bundle = { 'StripePaymentsBundle' => 'StripePayments/StripePayments/Resources/**/*.{lproj}' }
s.dependency 'StripeCore', s.version.to_s
s.subspec 'Stripe3DS2' do |sp|
sp.source_files = 'Stripe3DS2/Stripe3DS2/**/*.{h,m}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
/// :nodoc:
@_spi(STP) public final class StripePaymentsBundleLocator: BundleLocatorProtocol {
public static let internalClass: AnyClass = StripePaymentsBundleLocator.self
public static let bundleName = "StripePayments"
public static let bundleName = "StripePaymentsBundle"
#if SWIFT_PACKAGE
public static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripePaymentsUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.weak_framework = 'SwiftUI'
s.source_files = 'StripePaymentsUI/StripePaymentsUI/Source/**/*.swift'
s.ios.resource_bundle = { 'StripePaymentsUI' => 'StripePaymentsUI/StripePaymentsUI/Resources/**/*.{lproj,png,json,xcassets}' }
s.ios.resource_bundle = { 'StripePaymentsUIBundle' => 'StripePaymentsUI/StripePaymentsUI/Resources/**/*.{lproj,png,json,xcassets}' }
s.dependency 'StripeCore', s.version.to_s
s.dependency 'StripeUICore', s.version.to_s
s.dependency 'StripePayments', s.version.to_s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
/// :nodoc:
@_spi(STP) public final class StripePaymentsUIBundleLocator: BundleLocatorProtocol {
public static let internalClass: AnyClass = StripePaymentsUIBundleLocator.self
public static let bundleName = "StripePaymentsUI"
public static let bundleName = "StripePaymentsUIBundle"
#if SWIFT_PACKAGE
public static let spmResourcesBundle = Bundle.module
#endif
Expand Down
2 changes: 1 addition & 1 deletion StripeUICore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.weak_framework = 'SwiftUI'
s.source_files = 'StripeUICore/StripeUICore/**/*.swift'
s.ios.resource_bundle = { 'StripeUICore' => 'StripeUICore/StripeUICore/Resources/**/*.{lproj,png,json,xcassets}' }
s.ios.resource_bundle = { 'StripeUICoreBundle' => 'StripeUICore/StripeUICore/Resources/**/*.{lproj,png,json,xcassets}' }
s.dependency 'StripeCore', "#{s.version}"
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation

@_spi(STP) public final class StripeUICoreBundleLocator: BundleLocatorProtocol {
public static let internalClass: AnyClass = StripeUICoreBundleLocator.self
public static let bundleName = "StripeUICore"
public static let bundleName = "StripeUICoreBundle"
#if SWIFT_PACKAGE
public static let spmResourcesBundle = Bundle.module
#endif
Expand Down
Loading

0 comments on commit 8c1ba23

Please sign in to comment.