Skip to content

Commit 4b732b4

Browse files
committed
version 0.15.0
1 parent 68678c7 commit 4b732b4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Sources/iOSShared/Alerty/SheetyDisplayer.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ import SwiftUI
1111
// Because I'm not getting the callbacks for displaying/hiding view when displaying a sheet. And because I want to display errors/alerts on these sheets.
1212

1313
extension View {
14-
public func sheetyDisplayer<V: View>(show: Binding<Bool>, subscriber: AlertySubscriber, view: V) -> some View {
14+
public func sheetyDisplayer<V: View>(show: Binding<Bool>, subscriber: AlertySubscriber, onDismiss: (() -> Void)? = nil, view: V) -> some View {
1515

1616
self.sheet(isPresented: show, onDismiss: {
1717
subscriber.screenDisplayed = true
18+
onDismiss?()
1819
}, content: { ()->(V) in
1920
subscriber.screenDisplayed = false
2021
return view
2122
})
2223
}
2324

24-
public func sheetyDisplayer<Item, Content>(item: Binding<Item?>, subscriber: AlertySubscriber, @ViewBuilder content: @escaping (Item) -> Content) -> some View where Item : Identifiable, Content : View {
25+
public func sheetyDisplayer<Item, Content>(item: Binding<Item?>, subscriber: AlertySubscriber, onDismiss: (() -> Void)? = nil, @ViewBuilder content: @escaping (Item) -> Content) -> some View where Item : Identifiable, Content : View {
2526

2627
self.sheet(item: item, onDismiss: {
2728
subscriber.screenDisplayed = true
29+
onDismiss?()
2830
}, content: { (item: Item) -> Content in
2931
subscriber.screenDisplayed = false
3032
return content(item)

VERSIONS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
iOSShared
22

3+
Version 0.15.0 (7/18/21)
4+
Added onDismiss to sheetyDisplayer.
5+
36
Version 0.14.2 (7/1/21)
47
Added `addColumn` method.
58

0 commit comments

Comments
 (0)