I am having issues using a View Controller modally for a sign in page. I can get the controller to appear but I can not change it from full size.
I am trying to present the popover in the center of the screen with a faded background. The popover should dismiss when I click outside of the view.
I have looked through the questions and answers throughout the site and have not found one that has worked for me.
Here is the code I have:
import UIKit
class SignInView: UIViewController, UIPopoverPresentationControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "popoverSegue" {
var popover = segue.destination as! SignInPopView
popover.popoverPresentationController!.delegate = self
popover.modalPresentationStyle = UIModalPresentationStyle.popover
popover.preferredContentSize = CGSize(width: 375, height: 500)
}
}