From 7532c89f6ff6b33f69e821c6a7a9779c790f64cc Mon Sep 17 00:00:00 2001 From: Philipp Schmid <25935690+phil1995@users.noreply.github.com> Date: Mon, 5 Dec 2022 23:58:58 +0100 Subject: [PATCH 1/3] Fix missing navigation bar items on iOS 14 as `viewDidLoad` gets not called for a UIHostingController on iOS 14. --- .../S3/S3AuthenticationViewController.swift | 15 +++++++++++++-- .../WebDAVAuthenticationViewController.swift | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Cryptomator/S3/S3AuthenticationViewController.swift b/Cryptomator/S3/S3AuthenticationViewController.swift index c944e0655..05fade6b6 100644 --- a/Cryptomator/S3/S3AuthenticationViewController.swift +++ b/Cryptomator/S3/S3AuthenticationViewController.swift @@ -11,14 +11,14 @@ import CryptomatorCommonCore import SwiftUI import UIKit -class S3AuthenticationViewController: UIHostingController { +class S3AuthenticationViewController: UIViewController { weak var coordinator: (Coordinator & S3Authenticating)? let viewModel: S3AuthenticationViewModel private var subscriptions = Set() init(viewModel: S3AuthenticationViewModel) { self.viewModel = viewModel - super.init(rootView: S3AuthenticationView(viewModel: viewModel)) + super.init(nibName: nil, bundle: nil) } @available(*, unavailable) @@ -28,6 +28,8 @@ class S3AuthenticationViewController: UIHostingController override func viewDidLoad() { super.viewDidLoad() + setupSwiftUIView() + let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(done)) navigationItem.rightBarButtonItem = doneButton let cancelButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancel)) @@ -64,4 +66,13 @@ class S3AuthenticationViewController: UIHostingController @objc func cancel() { coordinator?.cancel() } + + private func setupSwiftUIView() { + let child = UIHostingController(rootView: S3AuthenticationView(viewModel: viewModel)) + addChild(child) + view.addSubview(child.view) + child.didMove(toParent: self) + child.view.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate(child.view.constraints(equalTo: view)) + } } diff --git a/Cryptomator/WebDAV/WebDAVAuthenticationViewController.swift b/Cryptomator/WebDAV/WebDAVAuthenticationViewController.swift index 93946834d..3d3ca7e75 100644 --- a/Cryptomator/WebDAV/WebDAVAuthenticationViewController.swift +++ b/Cryptomator/WebDAV/WebDAVAuthenticationViewController.swift @@ -13,15 +13,15 @@ import Promises import SwiftUI import UIKit -class WebDAVAuthenticationViewController: UIHostingController { +class WebDAVAuthenticationViewController: UIViewController { weak var coordinator: (Coordinator & WebDAVAuthenticating)? - private var viewModel: WebDAVAuthenticationViewModel + private let viewModel: WebDAVAuthenticationViewModel private var cancellables = Set() private var hud: ProgressHUD? init(viewModel: WebDAVAuthenticationViewModel) { self.viewModel = viewModel - super.init(rootView: WebDAVAuthentication(viewModel: viewModel)) + super.init(nibName: nil, bundle: nil) } @available(*, unavailable) @@ -31,6 +31,8 @@ class WebDAVAuthenticationViewController: UIHostingController Date: Mon, 5 Dec 2022 23:59:21 +0100 Subject: [PATCH 2/3] Fix WebDAVAuthentication appearance on iOS 14 --- Cryptomator/WebDAV/WebDAVAuthentication.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cryptomator/WebDAV/WebDAVAuthentication.swift b/Cryptomator/WebDAV/WebDAVAuthentication.swift index de6d56239..de649a631 100644 --- a/Cryptomator/WebDAV/WebDAVAuthentication.swift +++ b/Cryptomator/WebDAV/WebDAVAuthentication.swift @@ -20,7 +20,7 @@ struct WebDAVAuthentication: View { @FocusStateLegacy private var focusedField: Fields? = .url var body: some View { - List { + Form { TextField(LocalizedString.getValue("common.cells.url"), text: $viewModel.url) .keyboardType(.URL) .disableAutocorrection(true) From 2853931681ce25e3ea1acdd6f957c6692efae78b Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Tue, 6 Dec 2022 15:40:12 +0100 Subject: [PATCH 3/3] Preparing 2.4.3 --- Cryptomator.xcodeproj/project.pbxproj | 4 ++-- fastlane/changelog.txt | 5 +---- fastlane/metadata/de-DE/release_notes.txt | 5 +---- fastlane/metadata/en-US/release_notes.txt | 5 +---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Cryptomator.xcodeproj/project.pbxproj b/Cryptomator.xcodeproj/project.pbxproj index c94defff9..f6e94d704 100644 --- a/Cryptomator.xcodeproj/project.pbxproj +++ b/Cryptomator.xcodeproj/project.pbxproj @@ -3254,7 +3254,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.4.2; + MARKETING_VERSION = 2.4.3; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -3316,7 +3316,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.4.2; + MARKETING_VERSION = 2.4.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200"; diff --git a/fastlane/changelog.txt b/fastlane/changelog.txt index 24660b0d2..881ba56fc 100644 --- a/fastlane/changelog.txt +++ b/fastlane/changelog.txt @@ -1,4 +1 @@ -- Added possibility to edit WebDAV connections (#256) -- Added Danish translation -- Fixed missing files when encrypted files are offloaded in iCloud Drive (#279) -- Fixed flickering when vault list is empty (#257) \ No newline at end of file +- Fixed missing buttons when adding WebDAV/S3 connections on iOS 13/14 (#280, #282) \ No newline at end of file diff --git a/fastlane/metadata/de-DE/release_notes.txt b/fastlane/metadata/de-DE/release_notes.txt index 406863f8d..a69bf006c 100644 --- a/fastlane/metadata/de-DE/release_notes.txt +++ b/fastlane/metadata/de-DE/release_notes.txt @@ -1,4 +1 @@ -- Möglichkeit zum Bearbeiten von WebDAV-Verbindungen hinzugefügt (#256) -- Dänische Übersetzung hinzugefügt -- Fehlende Dateien behoben, wenn verschlüsselte Dateien in iCloud Drive nicht lokal vorliegen (#279) -- Flackern behoben, wenn die Tresorliste leer ist (#257) \ No newline at end of file +- Fehlende Buttons beim Hinzufügen von WebDAV/S3-Verbindungen unter iOS 13/14 behoben (#280, #282) \ No newline at end of file diff --git a/fastlane/metadata/en-US/release_notes.txt b/fastlane/metadata/en-US/release_notes.txt index 24660b0d2..881ba56fc 100644 --- a/fastlane/metadata/en-US/release_notes.txt +++ b/fastlane/metadata/en-US/release_notes.txt @@ -1,4 +1 @@ -- Added possibility to edit WebDAV connections (#256) -- Added Danish translation -- Fixed missing files when encrypted files are offloaded in iCloud Drive (#279) -- Fixed flickering when vault list is empty (#257) \ No newline at end of file +- Fixed missing buttons when adding WebDAV/S3 connections on iOS 13/14 (#280, #282) \ No newline at end of file