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

SwiftUI improvements #133

Merged
merged 1 commit into from
Mar 6, 2024
Merged

SwiftUI improvements #133

merged 1 commit into from
Mar 6, 2024

Conversation

markmur
Copy link
Contributor

@markmur markmur commented Feb 23, 2024

What changes are you making?

  • Rename CheckoutViewController.Representable to CheckoutSheet, Deprecate CheckoutViewController.Representable
  • Add modifiers for colorScheme, backgroundColor, tintColor and title
  • Removes the need for onReceive
  • Improve sample app by adding cart functionality, triggering the checkout from another sheet
  • Add tests for SwiftUI lifecycle methods
  • Add tests for configuration modifiers
  • Update readme
Video walkthrough of improved sample app
swift-ui-improvements.mp4
.sheet(isPresented: $isShowingCheckout, onDismiss: didDismiss) {
-  CheckoutViewController.Representable(checkout: $checkoutURL, delegate: eventHandler)
-    .onReceive(eventHandler.$didCancel, perform: { didCancel in
-      if didCancel {
-        isShowingCheckout = false
-      }
-    })
+  CheckoutSheet(checkout: $checkoutURL)
+    .title("Custom title")
+    .colorScheme(.automatic)
+    .backgroundColor(.black)
+    .tintColor(.systemBlue)
+    .onCancel {}
+    .onComplete { event in }
+    .onPixelEvent { event in }
+    .onFail { error in }
}

image


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines.
  • I have read and agree with the Code of Conduct.
  • I've updated the README.
  • I've updated any documentation related to these changes.

Checklist for releasing a new version
  • I have bumped the version number in the podspec file.
  • I have bumped the version number in the README.
  • I have added a Changelog entry.

Tip

See the Contributing documentation for instructions on how to publish a new version of the library.

@markmur markmur self-assigned this Feb 23, 2024
@markmur markmur mentioned this pull request Feb 23, 2024
15 tasks
@markmur markmur force-pushed the v2 branch 2 times, most recently from b283975 to 6f571ec Compare February 26, 2024 16:38
@markmur markmur force-pushed the markmur/swift-ui-improvements branch 11 times, most recently from 8e7bd87 to 160239f Compare March 4, 2024 10:41
@markmur markmur marked this pull request as ready for review March 4, 2024 10:41
@markmur markmur requested a review from a team as a code owner March 4, 2024 10:41
@markmur markmur requested review from josemiguel-alvarez, kiftio and leandrooriente and removed request for a team March 4, 2024 10:42
@markmur markmur force-pushed the markmur/swift-ui-improvements branch 5 times, most recently from 196a011 to e886664 Compare March 4, 2024 11:51
@markmur markmur force-pushed the markmur/swift-ui-improvements branch 2 times, most recently from 83e2ddf to 6091c01 Compare March 5, 2024 09:17
@markmur markmur force-pushed the v2 branch 2 times, most recently from 45a129f to 3d0054e Compare March 5, 2024 15:38
@markmur markmur force-pushed the markmur/swift-ui-improvements branch 7 times, most recently from fa304da to 556cbd8 Compare March 6, 2024 13:08
@markmur markmur force-pushed the markmur/swift-ui-improvements branch from 556cbd8 to c6f0c7b Compare March 6, 2024 13:09
@markmur markmur merged commit 997944b into v2 Mar 6, 2024
6 checks passed
@markmur markmur deleted the markmur/swift-ui-improvements branch March 6, 2024 13:32
kiftio pushed a commit that referenced this pull request Mar 18, 2024
* Add Order details to CheckoutCompleted event (#128)

* Update schema from 7.0 to 8.0 (#132)

* Make title configurable (#138)

* Replace loading spinner with progress bar (#129)

* SwiftUI improvements (#133)

* Return View from present method (#140)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants