Use .cancellationAction placement for close button

This commit is contained in:
Davide De Rosa 2022-04-19 23:11:04 +02:00
parent 5b2ccaa110
commit 1cfe6167e0
1 changed files with 2 additions and 2 deletions

View File

@ -280,7 +280,7 @@ extension String {
extension View { extension View {
func themeCloseItem(presentationMode: Binding<PresentationMode>) -> some ToolbarContent { func themeCloseItem(presentationMode: Binding<PresentationMode>) -> some ToolbarContent {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .cancellationAction) {
Button { Button {
presentationMode.wrappedValue.dismiss() presentationMode.wrappedValue.dismiss()
} label: { } label: {
@ -290,7 +290,7 @@ extension View {
} }
func themeCloseItem(isPresented: Binding<Bool>) -> some ToolbarContent { func themeCloseItem(isPresented: Binding<Bool>) -> some ToolbarContent {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .cancellationAction) {
Button { Button {
isPresented.wrappedValue = false isPresented.wrappedValue = false
} label: { } label: {