Skip to content

Commit

Permalink
Switch to SVGs, adopt latest assets (stripe#2977)
Browse files Browse the repository at this point in the history
## Summary
* Migrated payments frameworks from @3x pngs to asset catalogs 
* Used SVGs/PDFs where possible, created new @2x/@1x representations if
source vectors were not available
* Removed some hacks we had in place for dark mode asset support, as
this is now handled by the system
* Bumped swift-tools-version to fix a bug with resource handling.
Migrated StripeCardScan models to copy `mlmodelc` files, as the newer
toolset flatten the hierarchy of the files contained in the mlmodelcs.


## Motivation
Easier for designers and engineers, enables support for visionOS and
future platforms.

## Testing
CI, updated existing snapshot tests and checked with Kaleidoscope
- [x] Manually check example Cocoapods app
- [x] Manually check example Carthage app
- [x] Manually check example SPM app

## Changelog
Added
  • Loading branch information
davidme-stripe authored Oct 13, 2023
1 parent efeb1ac commit ceedf66
Show file tree
Hide file tree
Showing 819 changed files with 3,046 additions and 113 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## X.X.X
### PaymentsUI
* [Fixed] An issue with `STPPaymentCardTextField`, where the card params were not updated after deleting an empty sub field.
* [Fixed] Switched to Asset Catalogs and updated to the latest card brand logos.

### Payments
* [Added] Support for MobilePay bindings.
Expand Down
13 changes: 7 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.7
import PackageDescription

let package = Package(
Expand Down Expand Up @@ -48,7 +48,7 @@ let package = Package(
path: "Stripe/StripeiOS",
exclude: ["Info.plist"],
resources: [
.process("Resources/Images")
.process("Resources/StripeiOS.xcassets")
]
),
.target(
Expand Down Expand Up @@ -94,7 +94,8 @@ let package = Package(
path: "StripeCardScan/StripeCardScan",
exclude: ["Info.plist"],
resources: [
.process("Resources/CompiledModels")
.copy("Resources/CompiledModels/UxModel.mlmodelc"),
.copy("Resources/CompiledModels/SSDOcr.mlmodelc")
]
),
.target(
Expand All @@ -103,7 +104,7 @@ let package = Package(
path: "StripeUICore/StripeUICore",
exclude: ["Info.plist"],
resources: [
.process("Resources/Images"),
.process("Resources/StripeUICore.xcassets"),
.process("Resources/JSON")
]
),
Expand All @@ -122,7 +123,7 @@ let package = Package(
path: "StripePaymentsUI/StripePaymentsUI",
exclude: ["Info.plist"],
resources: [
.process("Resources/Images"),
.process("Resources/StripePaymentsUI.xcassets"),
.process("Resources/JSON")
]
),
Expand All @@ -132,7 +133,7 @@ let package = Package(
path: "StripePaymentSheet/StripePaymentSheet",
exclude: ["Info.plist"],
resources: [
.process("Resources/Images"),
.process("Resources/StripePaymentSheet.xcassets"),
.process("Resources/JSON")
]
),
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}' }
s.ios.resource_bundle = { 'Stripe' => '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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Stripe/StripeiOS/Resources/Images/[email protected]
Binary file not shown.
Binary file removed Stripe/StripeiOS/Resources/Images/[email protected]
Binary file not shown.
Binary file removed Stripe/StripeiOS/Resources/Images/[email protected]
Binary file not shown.
Binary file removed Stripe/StripeiOS/Resources/Images/[email protected]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_card_form_amex_cvc.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_card_form_back.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_card_form_front.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
File renamed without changes
6 changes: 6 additions & 0 deletions Stripe/StripeiOS/Resources/StripeiOS.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_affin_bank.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_alliance_bank.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_ambank.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_bank_islam.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_bank_muamalat.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_bank_rakyat.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_bsn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_cimb.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "stp_bank_fpx_hong_leong_bank.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
File renamed without changes
Loading

0 comments on commit ceedf66

Please sign in to comment.