Improved sizing of add feed modal on iPad

This commit is contained in:
Phil Viso 2019-05-19 17:47:33 -05:00
parent bce45d28e4
commit 2f82f05721
3 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,8 @@ protocol AddContainerViewControllerChildDelegate: UIViewController {
class AddContainerViewController: UIViewController { class AddContainerViewController: UIViewController {
static let preferredContentSizeForFormSheetDisplay = CGSize(width: 360.0, height: 400.0)
@IBOutlet weak var cancelButton: UIBarButtonItem! @IBOutlet weak var cancelButton: UIBarButtonItem!
@IBOutlet weak var activityIndicatorView: UIActivityIndicatorView! @IBOutlet weak var activityIndicatorView: UIActivityIndicatorView!
@IBOutlet weak var addButton: UIBarButtonItem! @IBOutlet weak var addButton: UIBarButtonItem!

View File

@ -434,8 +434,10 @@ class MasterFeedViewController: ProgressTableViewController, UndoableCommandRunn
@IBAction func add(_ sender: UIBarButtonItem) { @IBAction func add(_ sender: UIBarButtonItem) {
let addViewController = UIStoryboard.add.instantiateInitialViewController()! let addViewController = UIStoryboard.add.instantiateInitialViewController()!
addViewController.modalPresentationStyle = .popover addViewController.modalPresentationStyle = .formSheet
addViewController.preferredContentSize = AddContainerViewController.preferredContentSizeForFormSheetDisplay
addViewController.popoverPresentationController?.barButtonItem = sender addViewController.popoverPresentationController?.barButtonItem = sender
self.present(addViewController, animated: true) self.present(addViewController, animated: true)
} }

View File

@ -227,6 +227,7 @@ private extension SettingsViewController {
let addNavViewController = UIStoryboard.add.instantiateInitialViewController() as! UINavigationController let addNavViewController = UIStoryboard.add.instantiateInitialViewController() as! UINavigationController
let addViewController = addNavViewController.topViewController as! AddContainerViewController let addViewController = addNavViewController.topViewController as! AddContainerViewController
addNavViewController.modalPresentationStyle = .formSheet addNavViewController.modalPresentationStyle = .formSheet
addNavViewController.preferredContentSize = AddContainerViewController.preferredContentSizeForFormSheetDisplay
addViewController.initialFeed = appNewsURLString addViewController.initialFeed = appNewsURLString
addViewController.initialFeedName = "NetNewsWire News" addViewController.initialFeedName = "NetNewsWire News"