Differences From Artifact [0d004c181f]:
- File iOS/SelectKeyFileController.swift — part of check-in [74b74f8fbd] at 2024-08-11 09:08:07 on branch trunk — Change license to unmodified ISC (user: js, size: 4325) [annotate] [blame] [check-ins using]
To Artifact [969106a0b4]:
- File
iOS/SelectKeyFileController.swift
— part of check-in
[0c2ffe58fd]
at
2024-08-25 10:48:32
on branch trunk
— [iOS] Remove key upload functionality
It was never finished and uploading a key file unencrypted via WiFi is a
bad idea anyway. (user: js, size: 2715) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 | import ObjFW import UIKit class SelectKeyFileController: UITableViewController { public var addSiteController: AddSiteController? private var keyFiles: [String] = [] | < < < < < < < < < < < < < < < < < < < < < < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | import ObjFW import UIKit class SelectKeyFileController: UITableViewController { public var addSiteController: AddSiteController? private var keyFiles: [String] = [] override func viewDidLoad() { super.viewDidLoad() guard let documentDirectory = NSSearchPathForDirectoriesInDomains( .documentDirectory, .userDomainMask, true).first else { print("Could not get key files: No documents directory") navigationController?.popViewController(animated: true) return } do { keyFiles = try FileManager.default.contentsOfDirectory( atPath: documentDirectory).sorted() } catch let error as NSError { print("Could not get key files: \(error)") navigationController?.popViewController(animated: true) return } } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return keyFiles.count + 1 } |
︙ | ︙ | |||
88 89 90 91 92 93 94 | addSiteController?.keyFile = indexPath.row > 0 ? keyFiles[indexPath.row - 1] : nil addSiteController?.keyFileLabel?.text = indexPath.row > 0 ? keyFiles[indexPath.row - 1] : "None" self.navigationController?.popViewController(animated: true) } | | < < < < < < < < < < < < < < < < < < < < < < < < < | 66 67 68 69 70 71 72 73 | addSiteController?.keyFile = indexPath.row > 0 ? keyFiles[indexPath.row - 1] : nil addSiteController?.keyFileLabel?.text = indexPath.row > 0 ? keyFiles[indexPath.row - 1] : "None" self.navigationController?.popViewController(animated: true) } } |