From 8cdd43e360da4dc621b8628f3f2db2078be71f7a Mon Sep 17 00:00:00 2001 From: kean Date: Mon, 6 Jan 2025 14:30:26 -0500 Subject: [PATCH 1/2] Enable zoom transitions in Reader (iPad) --- .../Reader/Cards/ReaderPostCell.swift | 4 ++++ .../Controllers/ReaderStreamViewController.swift | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCell.swift b/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCell.swift index d5b45aa84d1c..0d98025c8c78 100644 --- a/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCell.swift +++ b/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCell.swift @@ -59,6 +59,10 @@ final class ReaderPostCell: ReaderStreamBaseCell { } return ImageSize(scaling: CGSize(width: coverWidth, height: coverWidth), in: window) } + + func getViewForZoomTransition() -> UIView { + view + } } private final class ReaderPostCellView: UIView { diff --git a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderStreamViewController.swift b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderStreamViewController.swift index 21c787b39fb5..bdb482407384 100644 --- a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderStreamViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderStreamViewController.swift @@ -1379,6 +1379,10 @@ extension ReaderStreamViewController: WPTableViewHandlerDelegate { // Check to see if we need to load more. syncMoreContentIfNeeded(for: tableView, indexPathForVisibleRow: indexPath) + if traitCollection.horizontalSizeClass == .regular, #available(iOS 18, *) { + cell.selectionStyle = .none + } + guard cell.isKind(of: ReaderCrossPostCell.self) else { return } @@ -1471,6 +1475,18 @@ extension ReaderStreamViewController: WPTableViewHandlerDelegate { WPAnalytics.trackReader(.readerPostCardTapped, properties: topicPropertyForStats() ?? [:]) } + if traitCollection.horizontalSizeClass == .regular, #available(iOS 18, *) { + controller.preferredTransition = .zoom { [weak self] context in + guard let self, let cell = self.tableView.cellForRow(at: indexPath) else { + return nil + } + if let cell = (cell as? ReaderPostCell) { + return cell.getViewForZoomTransition() + } + return cell.contentView + } + } + navigationController?.pushViewController(controller, animated: true) tableView.deselectRow(at: indexPath, animated: false) From 7584f56738c99ebb9abaee55ca63968f4ae52eef Mon Sep 17 00:00:00 2001 From: kean Date: Mon, 6 Jan 2025 14:32:22 -0500 Subject: [PATCH 2/2] Update release notes --- RELEASE-NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index e340975dad7f..9dc4a9881152 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -14,7 +14,7 @@ * [*] Fix an issue with comments being lost on request failure [#23942] * [*] Fix an issue with Referrers in Stats showing invalid icons [#23943] * [*] Update site menu style on iPhone [#23944] -* [*] Integrate zoom transitions in Themes [#23945] +* [*] Integrate zoom transitions in Themes, Reader [#23945, #23947] 25.6