From 2c5888643938e48b711bae55e615e9a77f4c1f3f Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Tue, 2 Nov 2021 23:39:57 -0400 Subject: [PATCH] More updates to improve behaviour of the destinations list. --- DestinationsView.swift | 23 ++++++++++++++++------- ListenerGS/Info.plist | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/DestinationsView.swift b/DestinationsView.swift index 2c96021..9e73a76 100644 --- a/DestinationsView.swift +++ b/DestinationsView.swift @@ -13,10 +13,7 @@ struct Destination: Identifiable, Hashable { } struct DestinationsView: View { - @State private var destinations = [ - Destination(ipAddress: "192.168.1.20"), - Destination(ipAddress: "192.168.1.21") - ] + @State private var destinations:[Destination] = [] @State private var editMode = EditMode.inactive @State private var showPopover = false @State private var newDestination = "" @@ -51,13 +48,25 @@ struct DestinationsView: View { private var addPopover: some View { VStack { - Text("Enter the hostname or\nIP address of your GS:") + Text("Enter the hostname or IP address of your GS:") + .font(.title2) TextField("New destination", text: self.$newDestination) { isEditing in } onCommit: { onAdd() } - } - .padding() + .padding() + HStack { + Button("Cancel") { + self.showPopover = false + editMode = EditMode.inactive + } + .padding() + Button("Add") { + onAdd() + } + .padding() + } + }.padding() } private func onDelete(offsets: IndexSet) { diff --git a/ListenerGS/Info.plist b/ListenerGS/Info.plist index 0d7120c..b4e1640 100644 --- a/ListenerGS/Info.plist +++ b/ListenerGS/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 210 + 239 LSApplicationCategoryType public.app-category.utilities LSRequiresIPhoneOS