Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix/enable-markup-iOS16] Enabling Markup Mode on iOS 16 #1152

Merged
merged 6 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
Changelog for ownCloud iOS Client [unreleased] (UNRELEASED)
=======================================
The following sections list the changes in ownCloud iOS Client unreleased relevant to
ownCloud admins and users.

[unreleased]: https://github.com/owncloud/ios-app/compare/milestone/11.10.1...master

Summary
-------

* Bugfix - Enabling Markup Mode on iOS 16: [#1141](https://github.com/owncloud/ios-app/issues/1141)

Details
-------

* Bugfix - Enabling Markup Mode on iOS 16: [#1141](https://github.com/owncloud/ios-app/issues/1141)

Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar
items.

https://github.com/owncloud/ios-app/issues/1141

Changelog for ownCloud iOS Client [11.10.1] (2022-08-02)
=======================================
The following sections list the changes in ownCloud iOS Client 11.10.1 relevant to
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/1141
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Enabling Markup Mode on iOS 16

Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar items.

https://github.com/owncloud/ios-app/issues/1141
10 changes: 9 additions & 1 deletion ownCloud/Client/Actions/EditDocumentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,15 @@ 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 #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