Feature: make Reader use center window

This commit is contained in:
James Magahern
2022-08-22 17:10:47 -07:00
parent ac345ef613
commit 184396b1d8
8 changed files with 116 additions and 19 deletions

View File

@@ -55,7 +55,13 @@ class ReaderViewController: UIViewController
@objc
private func didTapDoneButton(_ sender: Any?) {
dismiss(animated: true, completion: nil)
if traitCollection.userInterfaceIdiom == .phone {
dismiss(animated: true, completion: nil)
} else {
if let sceneSession = view.window?.windowScene?.session {
UIApplication.shared.requestSceneSessionDestruction(sceneSession, options: nil, errorHandler: nil)
}
}
}
@objc