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

Paywalls: fix template 4 layout bug on iOS 16 #3381

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

NachoSoto
Copy link
Contributor

This only reproduces on iOS 16 and using the new displayCloseButton: true (because it embeds PaywallView in a NavigationView).

simulator_screenshot_EB70C623-426F-44C5-92BA-0BDA0D3F5AFE

The problem was that the template used ViewDimentionPreferenceKey in several parts of the hierarchy and SwiftUI mixes both.
I work around it by separating onWidthChange and onHeightChange.

@NachoSoto NachoSoto requested a review from a team November 2, 2023 19:39
This only reproduces on iOS 16 + using the new `displayCloseButton: true` (because it embeds `PaywallView` in a `NavigationView`).

The problem was that the template used `ViewDimentionPreferenceKey` in several parts of the hierarchy and `SwiftUI` mixes both.
I work around it by separating `onWidthChange` and `onHeightChange`.
@NachoSoto NachoSoto force-pushed the paywalls-template-4-layout-fix branch from 536f6a8 to 40ee848 Compare November 2, 2023 19:39
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Just a question, but I'm not sure if that's possible. Looks good though


static var defaultValue: Value = 10

static func reduce(value: inout Value, nextValue: () -> Value) {
static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to move this static method to the protocol considering it's repeated between width and height?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@NachoSoto NachoSoto enabled auto-merge (squash) November 3, 2023 19:50
@NachoSoto NachoSoto merged commit 2e37c30 into main Nov 3, 2023
17 of 19 checks passed
@NachoSoto NachoSoto deleted the paywalls-template-4-layout-fix branch November 3, 2023 20:08
NachoSoto pushed a commit that referenced this pull request Nov 7, 2023
**This is an automatic release.**

### RevenueCatUI
* `Paywalls`: fix Turkish discount string (#3385) via NachoSoto
(@NachoSoto)
* `Paywalls`: fix template 4 layout bug on iOS 16 (#3381) via NachoSoto
(@NachoSoto)
### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `a297205` to `0ddee10`
(#3383) via dependabot[bot] (@dependabot[bot])
### Other Changes
* `CircleCI`: fix `visionOS` job (#3384) via NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants