Last active
July 26, 2018 10:46
-
-
Save enigmatic7earth/fccd9a5df1660f5398daccdda8b37b59 to your computer and use it in GitHub Desktop.
Create popup using storyboards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func aboutTapped(_ sender: UIBarButtonItem) { | |
let storyboard = UIStoryboard.init(name: "Main", bundle: nil) | |
let vc = storyboard.instantiateViewController(withIdentifier: "aboutPopover") | |
vc.modalPresentationStyle = UIModalPresentationStyle.popover | |
let popvc = vc.popoverPresentationController | |
popvc?.delegate = self | |
popvc?.permittedArrowDirections = UIPopoverArrowDirection.any | |
popvc?.barButtonItem = sender | |
vc.preferredContentSize = CGSize.init(width: 300, height: 300) | |
self.present(vc, animated: true, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment