Commit Graph
5 Commits
Author SHA1 Message Date
NachoSotoandAndy Boedo af08736775 RevenueCatUI: added support to other deployment targets (#3392)
Follow up to #3378.

This allows us to link both `RevenueCat` and `RevenueCatUI` from
`PurchasesHybridCommon` supporting the same platforms.
The actual types might not be available in some platforms / versions,
but we can detect that at compile time.

See
https://app.circleci.com/pipelines/github/RevenueCat/purchases-hybrid-common/2564/workflows/ea6a4e24-e1eb-4c7a-a930-173945732999/jobs/10352

---------

Co-authored-by: Andy Boedo <andresboedo@gmail.com>
2023-11-08 07:35:19 -08:00
NachoSoto 2e37c30e4f Paywalls: fix template 4 layout bug on iOS 16 (#3381)
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](https://github.com/RevenueCat/purchases-ios/assets/685609/737680e1-4b95-41f3-9a09-c6e6cb7bd36e)

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`.
2023-11-03 13:08:06 -07:00
NachoSoto 2103b04762 Paywalls: added MIT license to all headers (#3084)
`Xcode` doesn't allow customizing the header (looks like maybe it worked
at some point but not anymore:
https://stackoverflow.com/questions/67614785/changing-the-default-header-comment-license-in-swift-package).

At least this adds the license to all the initial files in the package.
2023-09-14 18:28:11 -07:00
Josh HoltzandNachoSoto bb94dbbb11 Paywalls: new PaywallFooterView to replace modes (#3051)
## Motivation

It was a little unclear how and when to use the different `PaywallView`
modes (`.fullscreen`, `.card`, and `.condensedCard`). The actual
functionality of the modes is great but they seemed like three different
components in one view and it was just trying to do too much for one
public API.

This change will...
- Remove modes from being a public parameter in `PaywallView` and only
allow it to be full screen
- Create a new `PaywallFooterView` which will combine `.footer`
(previously `.card`) and `.condensedFooter` (previously
`.condensedCard`)
- Removed the `modes` parameter from `PaywallView`

### New `PaywallFooterView`

- Wraps `PaywallView` and will only choose between `.footer` and
`.footerCondensed`
- Currently offers a `condensed` parameter but this might be switched to
being a remote setting inside of `PaywalData`

### New `.paywallFooter()` view modifier

- Easy way for developers to place `PaywallFooterView` where it is
supposed to be placed
- This places the view in `.safeAreaInset(edge: .bottom)`
- This works on any view but is ideal in `ScrollView` as it will
automatically handle adjusting the scroll insets with the paywalls size

### New footer structure and animation (with some hacks)

- No parts of `PaywallFooterView` uses `.overlay` anymore
  - The whole grows in `.condensedFooter` when "All Plans" is toggled

## Demo

### My sample app


https://github.com/RevenueCat/purchases-ios/assets/401294/17c52bba-956d-404e-b991-a2272e7fc4f1

### Simple sample app 


https://github.com/RevenueCat/purchases-ios/assets/401294/4ea94156-8367-4dea-9640-0cce8ffa1deb

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
2023-09-14 18:28:11 -07:00
Josh HoltzandNachoSoto f11600db74 Paywalls: rename card to footer (#3049)
Rename "card" to "footer" to because that is how we expect developers to
use the current implementation of the non-fullscreen modes as a footer
to their custom paywalls.

- Renamed `card` to `footer`
- Renamed `condensedCard` to `condensedFooter`

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
2023-09-14 18:28:11 -07:00