aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-02 18:20:32 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-02 18:20:32 +0530
commit4c485cdbb28bd4e8c7a2b3c8427f52986529024f (patch)
treeed8293563b02480d811ae7f159d0836e7b7a2d3d /WireGuard/WireGuard/UI
parentDNSResolver: Bugfix: Always call completion handler (diff)
downloadwireguard-apple-4c485cdbb28bd4e8c7a2b3c8427f52986529024f.tar.xz
wireguard-apple-4c485cdbb28bd4e8c7a2b3c8427f52986529024f.zip
Tunnel edit: Ensure all key-value fields have a placeholder text
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift28
1 files changed, 23 insertions, 5 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index 17615ab..2f75869 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -190,10 +190,21 @@ extension TunnelEditTableViewController {
// Set key
cell.key = field.rawValue
// Set placeholder text
- if (field == .name || field == .privateKey) {
+ switch (field) {
+ case .name:
cell.placeholderText = "Required"
- } else if (field == .mtu || field == .listenPort) {
+ case .privateKey:
+ cell.placeholderText = "Required"
+ case .addresses:
+ cell.placeholderText = "Optional"
+ case .listenPort:
cell.placeholderText = "Automatic"
+ case .mtu:
+ cell.placeholderText = "Automatic"
+ case .dns:
+ cell.placeholderText = "Optional"
+ case .publicKey: break
+ case .generateKeyPair: break
}
// Set editable
if (field == .publicKey) {
@@ -282,12 +293,19 @@ extension TunnelEditTableViewController {
// Set key
cell.key = field.rawValue
// Set placeholder text
- if (field == .publicKey) {
+ switch (field) {
+ case .publicKey:
cell.placeholderText = "Required"
- } else if (field == .preSharedKey) {
+ case .preSharedKey:
+ cell.placeholderText = "Optional"
+ case .endpoint:
+ cell.placeholderText = "Optional"
+ case .allowedIPs:
cell.placeholderText = "Optional"
- } else if (field == .persistentKeepAlive) {
+ case .persistentKeepAlive:
cell.placeholderText = "Off"
+ case .excludePrivateIPs: break
+ case .deletePeer: break
}
// Set keyboardType
if (field == .persistentKeepAlive) {