Skip to content

Commit 9e157ac

Browse files
author
Thomas Taschauer
committed
fix toasts on ipad, workaround invisible text, address #42
1 parent 6ca26a4 commit 9e157ac

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

OpenDocumentReader/DocumentViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,11 @@ class DocumentViewController: UIViewController, DocumentDelegate {
223223

224224
func showToast(controller: UIViewController, message : String, seconds: Double, color: UIColor? = .gray, completion: (() -> Void)? = nil) {
225225
let alert = UIAlertController(title: nil, message: message, preferredStyle: .actionSheet)
226-
alert.view.backgroundColor = color
226+
// TODO: fix text invisible on iPad: https://github.com/TomTasche/OpenDocument.ios/issues/42
227+
//alert.view.backgroundColor = color
227228
alert.view.layer.cornerRadius = 15
228229

230+
alert.popoverPresentationController?.sourceView = menuButton.value(forKey: "view") as? UIView
229231
controller.present(alert, animated: true)
230232

231233
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + seconds) {

0 commit comments

Comments
 (0)