diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f521513e..0f4d2bb25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,17 +8,18 @@ ownCloud admins and users. Summary ------- -* Bugfix - Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141) +* Bugfix - Enabling Markup Mode on iOS 16, Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141) * Bugfix - Video Metadata Image: [#5296](https://github.com/owncloud/enterprise/issues/5296) * Change - New Dark Mode Themes: [#1146](https://github.com/owncloud/ios-app/issues/1146) Details ------- -* Bugfix - Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141) +* Bugfix - Enabling Markup Mode on iOS 16, Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141) - Fixes a bug when a new theme was activated, this causes that the UITabBar and UIToolbar does not - updates colours. + Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar + items. Furthermore when a new theme was choosen, this causes that the UITabBar and UIToolbar + does not updates colours. https://github.com/owncloud/ios-app/issues/1141 diff --git a/changelog/unreleased/1141 b/changelog/unreleased/1141 index 5ea56926d..41399b4a1 100644 --- a/changelog/unreleased/1141 +++ b/changelog/unreleased/1141 @@ -1,5 +1,6 @@ -Bugfix: Updating Theme +Bugfix: Enabling Markup Mode on iOS 16, Updating Theme -Fixes a bug when a new theme was activated, this causes that the UITabBar and UIToolbar does not updates colours. +Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar items. +Furthermore when a new theme was choosen, this causes that the UITabBar and UIToolbar does not updates colours. https://github.com/owncloud/ios-app/issues/1141 diff --git a/ownCloud/Client/Actions/EditDocumentViewController.swift b/ownCloud/Client/Actions/EditDocumentViewController.swift index a87477b4a..c4b66e0b2 100644 --- a/ownCloud/Client/Actions/EditDocumentViewController.swift +++ b/ownCloud/Client/Actions/EditDocumentViewController.swift @@ -125,7 +125,18 @@ class EditDocumentViewController: QLPreviewController, Themeable { @objc func enableEditingMode() { // Activate editing mode by performing the action on pencil icon. Unfortunately that's the only way to do it apparently - if #available(iOS 15.0, *) { + if #available(iOS 16.0, *) { + if self.navigationItem.rightBarButtonItems?.count ?? 0 > 3 { + guard let markupButton = self.navigationItem.rightBarButtonItems?[0] else { return } + _ = markupButton.target?.perform(markupButton.action, with: markupButton) + } else if self.toolbarItems?.count ?? 0 > 4 { + guard let markupButton = self.toolbarItems?[4] else { return } + _ = markupButton.target?.perform(markupButton.action, with: markupButton) + } else if self.toolbarItems?.count ?? 0 < 4 { + guard let markupButton = self.toolbarItems?[2] else { return } + _ = markupButton.target?.perform(markupButton.action, with: markupButton) + } + } else if #available(iOS 15.0, *) { if self.navigationItem.rightBarButtonItems?.count ?? 0 > 2 { guard let markupButton = self.navigationItem.rightBarButtonItems?[1] else { return } _ = markupButton.target?.perform(markupButton.action, with: markupButton)