Skip to content

Commit

Permalink
Merge pull request #55 from phjs/Fix-extension-signatures
Browse files Browse the repository at this point in the history
Fix extension signatures
  • Loading branch information
SvenTiigi committed Apr 26, 2022
2 parents 8d40ce0 + 2a9322a commit 7dcdbc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
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

0 comments on commit 7dcdbc2

Please sign in to comment.