Skip to content

Commit

Permalink
requireExplicitResponders Modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioPelaez committed Oct 21, 2023
1 parent 656749e commit 3d244b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/HierarchyResponder/Safety/Safety.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public extension View {
environment(\.responderSafetyLevel, level)
}

func requireExplicitResponders(_ flag: Bool) -> some View {
environment(\.requiresExplicitResponders, flag)
}

func registerHandler(for event: any Event.Type) -> some View {
transformEnvironment(\.handledEvents) { $0.append(event) }
}
Expand Down

0 comments on commit 3d244b1

Please sign in to comment.