Skip to content

Paywalls: add displayCloseButton to PaywallViewController#3391

Merged
NachoSoto merged 4 commits into
mainfrom
paywall-controller-close-button
Nov 8, 2023
Merged

Paywalls: add displayCloseButton to PaywallViewController#3391
NachoSoto merged 4 commits into
mainfrom
paywall-controller-close-button

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

See #3359.
This brings support for that parameter to the UIKit type.

See #3359.
This brings support for that parameter to the `UIKit` type.
@NachoSoto NachoSoto requested a review from a team November 7, 2023 22:47
@NachoSoto NachoSoto force-pushed the paywall-controller-close-button branch from 5f350e4 to e9e5229 Compare November 7, 2023 22:47
}

ProminentButton(title: "Present PaywallViewController") {
self.presentPaywallViewController()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This allows us to test it internally as well.

@NachoSoto NachoSoto added pr:feat A new feature and removed pr:feat A new feature labels Nov 7, 2023
}

return .init(rootView: AnyView(view))
return .init(rootView: view)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simplified this to avoid using AnyView too 🎉

Comment on lines +161 to +165
UIApplication.shared
.currentWindowScene?
.keyWindow?
.rootViewController?
.present(paywall, animated: true)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This isn't great (ignoring nils), but it's just a test app.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess we could log something if it's nil? Just so it's not confusing in case something goes wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

/// - Parameter offering: The `Offering` containing the desired `PaywallData` to display.
/// `Offerings.current` will be used by default.
/// - Parameter displayCloseButton: Set this to `true` to automatically include a close button.
@objc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this to make sure it's available since we don't have a RevenueCatUI Obj-C API tester.

@codecov

codecov Bot commented Nov 8, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1fc7dc9) 86.04% compared to head (6e159a0) 86.04%.
Report is 1 commits behind head on main.

❗ Current head 6e159a0 differs from pull request most recent head 33d54d8. Consider uploading reports for the commit 33d54d8 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3391   +/-   ##
=======================================
  Coverage   86.04%   86.04%           
=======================================
  Files         237      237           
  Lines       17187    17187           
=======================================
+ Hits        14788    14789    +1     
+ Misses       2399     2398    -1     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +161 to +165
UIApplication.shared
.currentWindowScene?
.keyWindow?
.rootViewController?
.present(paywall, animated: true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess we could log something if it's nil? Just so it's not confusing in case something goes wrong.

@NachoSoto NachoSoto enabled auto-merge (squash) November 8, 2023 15:39
@NachoSoto NachoSoto merged commit 610f971 into main Nov 8, 2023
@NachoSoto NachoSoto deleted the paywall-controller-close-button branch November 8, 2023 17:45
NachoSoto pushed a commit that referenced this pull request Nov 8, 2023
**This is an automatic release.**

### RevenueCatUI
* `Paywalls`: add `displayCloseButton` to `PaywallViewController`
(#3391) via NachoSoto (@NachoSoto)
* `Paywalls`: fix Turkish translation (#3389) via Dogancan Mavideniz
(@mavideniz)
* `Paywalls`: fix Turkish translation (#3388) via iremkaraoglu
(@iremkaraoglu)
### Other Changes
* `RevenueCatUI`: added support to other deployment targets (#3392) via
NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants