From 66379ed25c9f2a0979fa279aa4d6e6c3e4b0bcc9 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Tue, 13 Aug 2024 12:32:33 -0700 Subject: [PATCH 01/17] Add FeatureFormView+TitleVisibility --- .../FeatureFormView+TitleVisibility.swift | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift new file mode 100644 index 000000000..dbed19735 --- /dev/null +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift @@ -0,0 +1,34 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI + +public extension FeatureFormView { + /// The visibility of the form title. + enum TitleVisibility: Sendable { + /// The form title is hidden. + case hidden + /// The form title is visible. + case visible + } + + /// Specifies the visibility of the form title. + /// - Parameter visibility: The preferred visibility of the form title. + /// - Since: 200.6 + func formTitle(_ visibility: TitleVisibility) -> FeatureFormView { + var copy = self + copy.titleVisibility = visibility + return copy + } +} From 83632c3fa31bc229d92738f90708fa988f7b0efc Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Tue, 13 Aug 2024 12:33:04 -0700 Subject: [PATCH 02/17] Restructure FeatureFormView+ValidationErrorVisibility Allows FeatureFormView modifiers to be placed in any order --- .../FeatureFormView+ValidationErrorVisibility.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift index 6e3f31a4b..8f45d478f 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift @@ -26,8 +26,10 @@ public extension FeatureFormView { /// Specifies the visibility of validation errors in the form. /// - Parameter visibility: The preferred visibility of validation errors in the form. - func validationErrors(_ visibility: ValidationErrorVisibility) -> some View { - environment(\.validationErrorVisibility, visibility) + func validationErrors(_ visibility: ValidationErrorVisibility) -> FeatureFormView { + var copy = self + copy.validationErrorVisibility = visibility + return copy } } @@ -42,6 +44,6 @@ extension EnvironmentValues { /// The validation error visibility configuration of a form. @available(visionOS, unavailable) -private struct FormViewValidationErrorVisibility: EnvironmentKey { +struct FormViewValidationErrorVisibility: EnvironmentKey { static let defaultValue: FeatureFormView.ValidationErrorVisibility = .automatic } From 3dddcb351490ca22ca3bd518443a03531a5e7ea4 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Tue, 13 Aug 2024 12:34:34 -0700 Subject: [PATCH 03/17] Add titleVisibility & validationErrorVisibility to FeatureFormView --- .../Components/FeatureFormView/FeatureFormView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift index ca89fc9e8..747c7c695 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift @@ -76,6 +76,12 @@ public struct FeatureFormView: View { /// The title of the feature form view. @State private var title = "" + /// The title visibility configuration of the form. + var titleVisibility: TitleVisibility = .visible + + /// The validation error visibility configuration of the form. + var validationErrorVisibility: ValidationErrorVisibility = FormViewValidationErrorVisibility.defaultValue + /// Initializes a form view. /// - Parameters: /// - featureForm: The feature form defining the editing experience. @@ -95,7 +101,7 @@ public struct FeatureFormView: View { ScrollViewReader { scrollViewProxy in ScrollView { VStack(alignment: .leading) { - if !title.isEmpty { + if !title.isEmpty && titleVisibility == .visible { FormHeader(title: title) Divider() } @@ -123,6 +129,7 @@ public struct FeatureFormView: View { #if os(iOS) .scrollDismissesKeyboard(.immediately) #endif + .environment(\.validationErrorVisibility, validationErrorVisibility) .environmentObject(model) } } From 740d28c00b2900cf3ce7e281cb1003201b53cbec Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Tue, 13 Aug 2024 12:36:05 -0700 Subject: [PATCH 04/17] Add Since tag to `FeatureFormView.TitleVisibility` --- .../FeatureFormView/FeatureFormView+TitleVisibility.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift index dbed19735..1d2b11fca 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift @@ -16,6 +16,7 @@ import SwiftUI public extension FeatureFormView { /// The visibility of the form title. + /// - Since: 200.6 enum TitleVisibility: Sendable { /// The form title is hidden. case hidden From eee10efccfc6459d808b798c0be8a337baeffd30 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Wed, 14 Aug 2024 10:21:44 -0700 Subject: [PATCH 05/17] Add `PopupView.popupTitle(_:)` --- .../FeatureFormView/FeatureFormView.swift | 2 +- .../Components/Popups/PopupView.swift | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift index 747c7c695..e6a813ce8 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift @@ -76,7 +76,7 @@ public struct FeatureFormView: View { /// The title of the feature form view. @State private var title = "" - /// The title visibility configuration of the form. + /// The visibility of the form title. var titleVisibility: TitleVisibility = .visible /// The validation error visibility configuration of the form. diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index e935cc8e5..fa713a2dd 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -69,6 +69,9 @@ public struct PopupView: View { /// so that the the "close" button can close the view. private var showCloseButton = false + /// The visibility of the popup title. + private var titleVisibility: TitleVisibility = .visible + /// The result of evaluating the popup expressions. @State private var evaluation: Evaluation? @@ -78,7 +81,7 @@ public struct PopupView: View { public var body: some View { VStack(alignment: .leading) { HStack { - if !popup.title.isEmpty { + if !popup.title.isEmpty && titleVisibility == .visible { Text(popup.title) .font(.title) .fontWeight(.bold) @@ -203,6 +206,15 @@ extension PopupView { } extension PopupView { + /// The visibility of the popup title. + /// - Since: 200.6 + public enum TitleVisibility: Sendable { + /// The popup title is hidden. + case hidden + /// The popup title is visible. + case visible + } + /// Specifies whether a "close" button should be shown to the right of the popup title. If the "close" /// button is shown, you should pass in the `isPresented` argument to the `PopupView` /// initializer, so that the the "close" button can close the view. @@ -214,4 +226,13 @@ extension PopupView { copy.showCloseButton = newShowCloseButton return copy } + + /// Specifies the visibility of the popup title. + /// - Parameter visibility: The visibility of the popup title. + /// - Since: 200.6 + public func popupTitle(_ visibility: TitleVisibility) -> Self { + var copy = self + copy.titleVisibility = visibility + return copy + } } From 87dbeebd18d91ed9889727b700e3d62d497173cd Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Wed, 14 Aug 2024 10:52:23 -0700 Subject: [PATCH 06/17] Alphabetization --- .../Components/Popups/PopupView.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index fa713a2dd..0b9183723 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -215,6 +215,15 @@ extension PopupView { case visible } + /// Specifies the visibility of the popup title. + /// - Parameter visibility: The visibility of the popup title. + /// - Since: 200.6 + public func popupTitle(_ visibility: TitleVisibility) -> Self { + var copy = self + copy.titleVisibility = visibility + return copy + } + /// Specifies whether a "close" button should be shown to the right of the popup title. If the "close" /// button is shown, you should pass in the `isPresented` argument to the `PopupView` /// initializer, so that the the "close" button can close the view. @@ -226,13 +235,4 @@ extension PopupView { copy.showCloseButton = newShowCloseButton return copy } - - /// Specifies the visibility of the popup title. - /// - Parameter visibility: The visibility of the popup title. - /// - Since: 200.6 - public func popupTitle(_ visibility: TitleVisibility) -> Self { - var copy = self - copy.titleVisibility = visibility - return copy - } } From e94af762a6df3e572dff2f749d7c5ff94fcb47bb Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:08:34 -0800 Subject: [PATCH 07/17] Update FeatureFormView+FormHeader.swift --- ...swift => FeatureFormView+FormHeader.swift} | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) rename Sources/ArcGISToolkit/Components/FeatureFormView/{FeatureFormView+TitleVisibility.swift => FeatureFormView+FormHeader.swift} (63%) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+FormHeader.swift similarity index 63% rename from Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift rename to Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+FormHeader.swift index 1d2b11fca..7e9ddcd14 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+TitleVisibility.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+FormHeader.swift @@ -15,21 +15,12 @@ import SwiftUI public extension FeatureFormView { - /// The visibility of the form title. - /// - Since: 200.6 - enum TitleVisibility: Sendable { - /// The form title is hidden. - case hidden - /// The form title is visible. - case visible - } - - /// Specifies the visibility of the form title. - /// - Parameter visibility: The preferred visibility of the form title. - /// - Since: 200.6 - func formTitle(_ visibility: TitleVisibility) -> FeatureFormView { + /// Specifies the visibility of the form header. + /// - Parameter visibility: The preferred visibility of the form header. + /// - Since: 200.7 + func formHeader(_ visibility: Visibility) -> Self { var copy = self - copy.titleVisibility = visibility + copy.headerVisibility = visibility return copy } } From 3f18a96facf90eb653c69d03fa7b5f0c7cb63eff Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:14:54 -0800 Subject: [PATCH 08/17] Update FeatureFormView+ValidationErrorVisibility.swift --- .../FeatureFormView+ValidationErrorVisibility.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift index 8f45d478f..a2d2c2b77 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView+ValidationErrorVisibility.swift @@ -26,7 +26,7 @@ public extension FeatureFormView { /// Specifies the visibility of validation errors in the form. /// - Parameter visibility: The preferred visibility of validation errors in the form. - func validationErrors(_ visibility: ValidationErrorVisibility) -> FeatureFormView { + func validationErrors(_ visibility: ValidationErrorVisibility) -> Self { var copy = self copy.validationErrorVisibility = visibility return copy From 0fbd7037d76015844ebcef752fdca1f0b6dda184 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:17:16 -0800 Subject: [PATCH 09/17] Update FeatureFormView.swift --- .../Components/FeatureFormView/FeatureFormView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift index e6a813ce8..0c7d60756 100644 --- a/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift +++ b/Sources/ArcGISToolkit/Components/FeatureFormView/FeatureFormView.swift @@ -76,8 +76,8 @@ public struct FeatureFormView: View { /// The title of the feature form view. @State private var title = "" - /// The visibility of the form title. - var titleVisibility: TitleVisibility = .visible + /// The visibility of the form header. + var headerVisibility: Visibility = .automatic /// The validation error visibility configuration of the form. var validationErrorVisibility: ValidationErrorVisibility = FormViewValidationErrorVisibility.defaultValue @@ -101,7 +101,7 @@ public struct FeatureFormView: View { ScrollViewReader { scrollViewProxy in ScrollView { VStack(alignment: .leading) { - if !title.isEmpty && titleVisibility == .visible { + if !title.isEmpty && headerVisibility != .hidden { FormHeader(title: title) Divider() } From 585cb92fdde7b158177c4d43d6ed2d4c494e2ecf Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:54:17 -0800 Subject: [PATCH 10/17] Create PopupView+PopupHeader.swift --- .../Popups/PopupView+PopupHeader.swift | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Sources/ArcGISToolkit/Components/Popups/PopupView+PopupHeader.swift diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView+PopupHeader.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView+PopupHeader.swift new file mode 100644 index 000000000..519870fbb --- /dev/null +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView+PopupHeader.swift @@ -0,0 +1,26 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI + +public extension PopupView { + /// Specifies the visibility of the popup header. + /// - Parameter visibility: The preferred visibility of the popup header. + /// - Since: 200.7 + func popupHeader(_ visibility: Visibility) -> Self { + var copy = self + copy.headerVisibility = visibility + return copy + } +} From fd7a981eaa60eec6a78a331f3d404f8b215e9b81 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:55:21 -0800 Subject: [PATCH 11/17] Create PopupView+ShowCloseButton.swift --- .../Popups/PopupView+ShowCloseButton.swift | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Sources/ArcGISToolkit/Components/Popups/PopupView+ShowCloseButton.swift diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView+ShowCloseButton.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView+ShowCloseButton.swift new file mode 100644 index 000000000..b7a48ae52 --- /dev/null +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView+ShowCloseButton.swift @@ -0,0 +1,30 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI + +public extension PopupView /* Deprecated */ { + /// Specifies whether a "close" button should be shown to the right of the popup title. If the "close" + /// button is shown, you should pass in the `isPresented` argument to the `PopupView` + /// initializer, so that the the "close" button can close the view. + /// Defaults to `false`. + /// - Parameter newShowCloseButton: The new value. + /// - Returns: A new `PopupView`. + @available(*, deprecated, message: "Use 'popupHeader(_:)' instead.") + func showCloseButton(_ newShowCloseButton: Bool) -> Self { + var copy = self + copy.showCloseButton = newShowCloseButton + return copy + } +} From 5f3565dafbd447e8c529bbc535d4bd17ebedcccd Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:55:46 -0800 Subject: [PATCH 12/17] Make `showCloseButton` internal --- Sources/ArcGISToolkit/Components/Popups/PopupView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index 0b9183723..662b3887e 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -67,7 +67,7 @@ public struct PopupView: View { /// A Boolean value specifying whether a "close" button should be shown or not. If the "close" /// button is shown, you should pass in the `isPresented` argument to the initializer, /// so that the the "close" button can close the view. - private var showCloseButton = false + var showCloseButton = false /// The visibility of the popup title. private var titleVisibility: TitleVisibility = .visible From 759402a697888879f4e4f9043c4fbf4bf4c9ed1a Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:56:33 -0800 Subject: [PATCH 13/17] `titleVisibility` -> `headerVisibility` --- Sources/ArcGISToolkit/Components/Popups/PopupView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index 662b3887e..d654e317c 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -69,8 +69,8 @@ public struct PopupView: View { /// so that the the "close" button can close the view. var showCloseButton = false - /// The visibility of the popup title. - private var titleVisibility: TitleVisibility = .visible + /// The visibility of the popup header. + var headerVisibility: Visibility = .automatic /// The result of evaluating the popup expressions. @State private var evaluation: Evaluation? From 6e3f8e36c27575632c7576ed301a728254ceb83a Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:58:15 -0800 Subject: [PATCH 14/17] Update PopupView body implementation to consider header visibility --- .../Components/Popups/PopupView.swift | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index d654e317c..f572c9a5c 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -80,27 +80,29 @@ public struct PopupView: View { public var body: some View { VStack(alignment: .leading) { - HStack { - if !popup.title.isEmpty && titleVisibility == .visible { - Text(popup.title) - .font(.title) - .fontWeight(.bold) - } - Spacer() - if showCloseButton { - Button(String.close, systemImage: "xmark") { - isPresented?.wrappedValue = false + if headerVisibility != .hidden { + HStack { + if !popup.title.isEmpty { + Text(popup.title) + .font(.title) + .fontWeight(.bold) } - .labelStyle(.iconOnly) + Spacer() + if showCloseButton && isPresented != nil { + Button(String.close, systemImage: "xmark") { + isPresented?.wrappedValue = false + } + .labelStyle(.iconOnly) #if !os(visionOS) - .foregroundColor(.secondary) - .padding([.top, .bottom, .trailing], 4) - .symbolVariant(.circle) - .buttonStyle(.plain) + .foregroundColor(.secondary) + .padding([.top, .bottom, .trailing], 4) + .symbolVariant(.circle) + .buttonStyle(.plain) #endif + } } + Divider() } - Divider() Group { if let evaluation { if let error = evaluation.error { From 8d5d22044c6cba80420ebcd910156e0df4656308 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 15:58:38 -0800 Subject: [PATCH 15/17] Remove older modifier declarations --- .../Components/Popups/PopupView.swift | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index f572c9a5c..3863a4a68 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -206,35 +206,3 @@ extension PopupView { } } } - -extension PopupView { - /// The visibility of the popup title. - /// - Since: 200.6 - public enum TitleVisibility: Sendable { - /// The popup title is hidden. - case hidden - /// The popup title is visible. - case visible - } - - /// Specifies the visibility of the popup title. - /// - Parameter visibility: The visibility of the popup title. - /// - Since: 200.6 - public func popupTitle(_ visibility: TitleVisibility) -> Self { - var copy = self - copy.titleVisibility = visibility - return copy - } - - /// Specifies whether a "close" button should be shown to the right of the popup title. If the "close" - /// button is shown, you should pass in the `isPresented` argument to the `PopupView` - /// initializer, so that the the "close" button can close the view. - /// Defaults to `false`. - /// - Parameter newShowCloseButton: The new value. - /// - Returns: A new `PopupView`. - public func showCloseButton(_ newShowCloseButton: Bool) -> Self { - var copy = self - copy.showCloseButton = newShowCloseButton - return copy - } -} From 7df055f0acfcc3faf62b60eff32046e654b9d8b6 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 16:29:54 -0800 Subject: [PATCH 16/17] Update PopupView example and tutorial --- Examples/Examples/PopupExampleView.swift | 1 - .../Documentation.docc/Resources/PopupView/PopupViewStep6.swift | 1 - 2 files changed, 2 deletions(-) diff --git a/Examples/Examples/PopupExampleView.swift b/Examples/Examples/PopupExampleView.swift index f0df7d5f5..57a8d36a5 100644 --- a/Examples/Examples/PopupExampleView.swift +++ b/Examples/Examples/PopupExampleView.swift @@ -70,7 +70,6 @@ struct PopupExampleView: View { isPresented: $showPopup ) { [popup] in PopupView(popup: popup!, isPresented: $showPopup) - .showCloseButton(true) .padding() } } diff --git a/Sources/ArcGISToolkit/Documentation.docc/Resources/PopupView/PopupViewStep6.swift b/Sources/ArcGISToolkit/Documentation.docc/Resources/PopupView/PopupViewStep6.swift index 426db715c..d8c4fca8a 100644 --- a/Sources/ArcGISToolkit/Documentation.docc/Resources/PopupView/PopupViewStep6.swift +++ b/Sources/ArcGISToolkit/Documentation.docc/Resources/PopupView/PopupViewStep6.swift @@ -44,7 +44,6 @@ struct PopupExampleView: View { isPresented: $showPopup ) { [popup] in PopupView(popup: popup!, isPresented: $showPopup) - .showCloseButton(true) .padding() } } From acd8c3a5e1ae0207833fd7649dd690cfd4db7728 Mon Sep 17 00:00:00 2001 From: David Feinzimer Date: Mon, 18 Nov 2024 16:31:12 -0800 Subject: [PATCH 17/17] Remove showCloseButton usage --- Sources/ArcGISToolkit/Components/Popups/PopupView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift index 3863a4a68..4c65f2d98 100644 --- a/Sources/ArcGISToolkit/Components/Popups/PopupView.swift +++ b/Sources/ArcGISToolkit/Components/Popups/PopupView.swift @@ -88,7 +88,7 @@ public struct PopupView: View { .fontWeight(.bold) } Spacer() - if showCloseButton && isPresented != nil { + if isPresented != nil { Button(String.close, systemImage: "xmark") { isPresented?.wrappedValue = false }