Skip to content

Commit

Permalink
[fix/enable-markup-iOS16] Enabling Markup Mode on iOS 16 (#1152)
Browse files Browse the repository at this point in the history
* #1141 fixes enabling markup mode on iOS 16

* added changelog entry

* Calens changelog updated

* In some cases the number of toolbar buttons are less than 4

* Calens changelog updated

Co-authored-by: Matthias Hühne <>
Co-authored-by: hosy <hosy@users.noreply.github.com>
  • Loading branch information
hosy and hosy authored Sep 15, 2022
1 parent caea628 commit 5c9187b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions changelog/unreleased/1141
Original file line number Diff line number Diff line change
@@ -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
13 changes: 12 additions & 1 deletion ownCloud/Client/Actions/EditDocumentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5c9187b

Please sign in to comment.