Skip to content

Commit

Permalink
iOS 18 missing bars workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Amzd committed Jan 29, 2025
1 parent 180bcee commit d43cd6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,14 @@ extension ChatViewController {
let index = msgIds.firstIndex(of: message.id) ?? 0
let previewController = PreviewController(dcContext: dcContext, type: .multi(msgIds: msgIds, index: index))
previewController.delegate = self
present(previewController, animated: true)
if #available(iOS 18, *) {
// Pushing instead of presenting on iOS 18 makes sure it shows navigation
// and toolbar by default. On iOS 18 this still enables the swipe down to dismiss
// gesture and it still animates using previewController(_:transitionViewFor:)
navigationController?.pushViewController(previewController, animated: true)
} else {
present(previewController, animated: true)
}
}

private func didTapAsm(msg: DcMsg, orgText: String) {
Expand Down

0 comments on commit d43cd6f

Please sign in to comment.