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

Fix extension signatures #55

Merged
merged 2 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ let whatsnew = WhatsNew(
backgroundColor: .accentColor,
foregroundColor: .white,
hapticFeedback: .notification(.success),
onDimiss: {
onDismiss: {
print("WhatsNewView has been dismissed")
}
),
Expand Down Expand Up @@ -347,7 +347,7 @@ let version: WhatsNew.Version = .current()
A `WhatsNew.Title` represents the title text that is rendered above the features.

```swift
// Initialize by string literla
// Initialize by string literal
let title: WhatsNew.Title = "Continue"

// Initialize with text and foreground color
Expand Down
22 changes: 19 additions & 3 deletions Sources/Extensions/View+WhatsNewSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,34 @@ public extension View {
/// - versionStore: The optional WhatsNewVersionStore. Default value `nil`
/// - layout: The WhatsNew Layout. Default value `.default`
/// - onDimiss: The closure to execute when dismissing the sheet. Default value `nil`
@available(*, deprecated, renamed: "sheet(whatsNew:versionStore:layout:onDismiss:)")
func sheet(
whatsNew: Binding<WhatsNew?>,
versionStore: WhatsNewVersionStore? = nil,
layout: WhatsNew.Layout = .default,
onDimiss: (() -> Void)? = nil
onDimiss: (() -> Void)?
) -> some View {
self.sheet(whatsNew: whatsNew, versionStore: versionStore, layout: layout, onDismiss: onDimiss)
}

/// Presents a WhatsNewView using the given WhatsNew object as a data source for the sheet’s content.
/// - Parameters:
/// - whatsNew: A Binding to an optional WhatsNew object
/// - versionStore: The optional WhatsNewVersionStore. Default value `nil`
/// - layout: The WhatsNew Layout. Default value `.default`
/// - onDismiss: The closure to execute when dismissing the sheet. Default value `nil`
func sheet(
whatsNew: Binding<WhatsNew?>,
versionStore: WhatsNewVersionStore? = nil,
layout: WhatsNew.Layout = .default,
onDismiss: (() -> Void)? = nil
) -> some View {
self.modifier(
ManualWhatsNewSheetViewModifier(
whatsNew: whatsNew,
versionStore: versionStore,
layout: layout,
onDismiss: onDimiss
onDismiss: onDismiss
)
)
}
Expand Down Expand Up @@ -88,7 +104,7 @@ public extension View {
/// Auto-Presents a WhatsNewView to the user if needed based on the `WhatsNewEnvironment`
/// - Parameters:
/// - layout: The optional custom WhatsNew Layout. Default value `nil`
/// - onDimiss: The closure to execute when dismissing the sheet. Default value `nil`
/// - onDismiss: The closure to execute when dismissing the sheet. Default value `nil`
func whatsNewSheet(
layout: WhatsNew.Layout? = nil,
onDismiss: (() -> Void)? = nil
Expand Down