Skip to content

Commit

Permalink
view modifiers for dismissable views
Browse files Browse the repository at this point in the history
  • Loading branch information
nidegen committed May 17, 2020
1 parent 3a2cdda commit e6db851
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Sources/NDKit/View+Cancelable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ extension View {
}
}
}

public struct CancelableModifier: ViewModifier {
public func body(content: Content) -> some View {
CancelableView {
content
}
}
}
8 changes: 8 additions & 0 deletions Sources/NDKit/View+Dismissable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ extension View {
}
}
}

public struct DismissableModifier: ViewModifier {
public func body(content: Content) -> some View {
DismissableView {
content
}
}
}
10 changes: 9 additions & 1 deletion Sources/NDKit/View+Doable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import SwiftUI

public struct DobleView<Content> : View where Content : View {
public struct DoableView<Content> : View where Content : View {
let content: () -> Content

@Environment(\.presentationMode) var presentationMode
Expand Down Expand Up @@ -40,3 +40,11 @@ extension View {
}
}
}

public struct DoableModifier: ViewModifier {
public func body(content: Content) -> some View {
DoableView {
content
}
}
}

0 comments on commit e6db851

Please sign in to comment.