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

Rewrite the MobileBuyIntegration sample controllers in SwiftUI #244

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

markmur
Copy link
Contributor

@markmur markmur commented Nov 21, 2024

What changes are you making?

  • Rewrite the MobileBuyIntegration sample controllers in SwiftUI
  • Update branding
plant-sample-app.mp4

Before you merge

Important


@markmur markmur self-assigned this Nov 21, 2024
@markmur markmur requested a review from a team as a code owner November 21, 2024 10:54
@markmur markmur force-pushed the markmur/rewrite-to-swiftui branch 3 times, most recently from 8729f84 to b55f14b Compare November 21, 2024 11:01
@markmur markmur force-pushed the markmur/rewrite-to-swiftui branch from b55f14b to 4523601 Compare November 21, 2024 11:04
@markmur markmur force-pushed the markmur/rewrite-to-swiftui branch from 6a5dbda to 21e85dc Compare November 21, 2024 17:00
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

iOS 13 is obsolete and no longer receiving security updates

@markmur markmur force-pushed the markmur/rewrite-to-swiftui branch 6 times, most recently from 2bc019f to dec9a3d Compare November 26, 2024 10:07
@markmur markmur force-pushed the markmur/rewrite-to-swiftui branch from dec9a3d to ed603d9 Compare November 26, 2024 10:11
@markmur markmur force-pushed the markmur/rewrite-to-swiftui branch from 811428d to 39d48bb Compare November 26, 2024 10:58
@@ -29,6 +29,10 @@ extension Storefront.MoneyV2 {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.currencyCode = currencyCode.rawValue
return formatter.string(from: NSDecimalNumber(decimal: amount))
return isFree() ? "Free" : formatter.string(from: NSDecimalNumber(decimal: amount))
Copy link
Contributor

Choose a reason for hiding this comment

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

Gonna steal this for android 👍

@State private var product: Storefront.Product
@State private var handle: String?
@State private var loading = false
@State private var imageLoaded: Bool = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't tell if it's Github or the indentation is actually a bit off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's actually off. #247 will fix it

Text(product.description)
.font(.body)
.foregroundColor(.gray)
.lineLimit(descriptionExpanded ? 10 : 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think 10 for the expanded text is still bit too low for some of the products in the store (e.g. looking at Bird of paradise)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, probably. I'll account for this in the full redesign task

guard let variant = product.variants.nodes.first else { return }

loading = true
let start = Date()
Copy link
Contributor

Choose a reason for hiding this comment

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

Continuous clock looks interesting.. Although I'm not sure how easy it is to use with callbacks.

let clock = ContinuousClock()
let elapsed = clock.measure {
    someWork()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh interesting 🤔

Toggle("Handle Cart URLs", isOn: $appConfiguration.universalLinks.cart)
Toggle("Handle Product URLs", isOn: $appConfiguration.universalLinks.products)
Toggle("Handle all Universal Links", isOn: $appConfiguration.universalLinks.handleAllURLsInApp)
Toggle("Handle Checkout URLs", isOn: $config.universalLinks.checkout)
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to catch android up here at some point

@markmur markmur merged commit 56b5761 into main Nov 26, 2024
6 checks passed
@markmur markmur deleted the markmur/rewrite-to-swiftui branch November 26, 2024 14:15
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.

2 participants