Paywalls: improve landscape support of all templates#3471
Conversation
f2857b9 to
d97ac9a
Compare
| } | ||
|
|
||
| var isVerticalSizeCompact: Bool { | ||
| #if os(tvOS) |
There was a problem hiding this comment.
We don't support tvOS yet, but this is what we'll want to do anyway.
| .padding(.top, self.defaultVerticalPaddingLength) | ||
| } | ||
|
|
||
| // TODO: snapshots |
There was a problem hiding this comment.
TODO: need snapshots for landscape paywalls.
|
ohhh that is really cool |
Thanks for taking a close look at this! I'll check in more detail, but that's actually the default alignment for both the close button (navigation bar buttons) and the main content. |
d97ac9a to
3861659
Compare
3861659 to
2bea659
Compare
2bea659 to
c25d819
Compare
Paywalls: improve landscape support of all templatesPaywalls: improve landscape support of all templates
3cdd597 to
0b5f399
Compare
48bc434 to
0cc0f84
Compare
0cc0f84 to
501b604
Compare
| var userInterfaceIdiom: UserInterfaceIdiom { get } | ||
|
|
||
| /// `UserInterfaceSizeClass` is only available for macOS/watchOS/tvOS with Xcode 15 | ||
| #if swift(>=5.9) || (!os(macOS) && !os(watchOS) && !os(tvOS)) |
There was a problem hiding this comment.
Ideally we mark TemplateViewType as unavailable in these platforms (since it is), but that leads to a SwiftUI warning:
_modify accessor cannot be more available than unavailable enclosing scope
And having a warning breaks CocoaPods linting.
There was a problem hiding this comment.
what's the story with visionOS for these? wondering if it'd be easier or safer to allow-list iOS rather than deny-list the rest
There was a problem hiding this comment.
It is available in visionOS.
I went with deny-list because presumedly we'll remove these eventually when adding support for them (other than watchOS which uses a separate template)
| // tvOS never reports UserInterfaceSizeClass.compact | ||
| // but for the purposes of template layouts, we consider landscape | ||
| // on tvOS as compact to produce horizontal layouts. |
There was a problem hiding this comment.
this is a fair point, but it makes me wonder whether the flag should be named something more representative, like shouldUseLandscapeLayout or something, given that it's not really "compact" for tvOS and that on macOS it's neither compact nor not compact, right?
There was a problem hiding this comment.
Yup, I'll rename.
| @ViewBuilder | ||
| private var horizontalContent: some View { | ||
| VStack { | ||
| HStack { | ||
| VStack { | ||
| Spacer() | ||
| self.iconImage | ||
| Spacer() | ||
| self.title | ||
| Spacer() | ||
| self.subtitle | ||
| Spacer() | ||
| } | ||
| .scrollableIfNecessary() | ||
| .frame(maxHeight: .infinity) | ||
|
|
||
| VStack(spacing: self.defaultVerticalPaddingLength) { | ||
| Spacer() | ||
|
|
||
| self.packages | ||
| .scrollableIfNecessary() | ||
|
|
||
| Spacer(minLength: self.defaultVerticalPaddingLength) | ||
|
|
||
| self.subscribeButton | ||
| } | ||
| .frame(maxHeight: .infinity) | ||
| } | ||
|
|
||
| self.footer | ||
| } |
| var userInterfaceIdiom: UserInterfaceIdiom { get } | ||
|
|
||
| /// `UserInterfaceSizeClass` is only available for macOS/watchOS/tvOS with Xcode 15 | ||
| #if swift(>=5.9) || (!os(macOS) && !os(watchOS) && !os(tvOS)) |
There was a problem hiding this comment.
what's the story with visionOS for these? wondering if it'd be easier or safer to allow-list iOS rather than deny-list the rest
**This is an automatic release.** ### RevenueCatUI * `Paywalls`: add `PaywallFooterViewController` (#3486) via Toni Rico (@tonidero) * `Paywalls`: improve landscape support of all templates (#3471) via NachoSoto (@NachoSoto) * `Paywalls`: ensure footer links open in full-screen sheets (#3524) via NachoSoto (@NachoSoto) * `Paywalls`: improve `FooterView` text alignment (#3525) via NachoSoto (@NachoSoto) * Paywalls: Add dismissal method in `PaywallViewControllerDelegate` (#3493) via Toni Rico (@tonidero)

Template 2
Before
After
Template 3
Before
After
Template 4
Before
After
Template 5
Before
After