मैं एक पॉपअप बनाने की कोशिश कर रहा हूं जो एक बटन दबाकर प्रस्तुत किया जाएगा। Google में मिले निर्देशों का पालन करने का प्रयास किया लेकिन मेरा पॉप व्यू एक पूर्ण स्क्रीन में प्रस्तुत होता है और इसकी पृष्ठभूमि काला है।पॉपअप UIViewController
class ViewController: UIViewController, UIPopoverPresentationControllerDelegate {
@IBAction func someButtonPressed(sender: UIButton) {
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let popupVC = storyboard.instantiateViewControllerWithIdentifier("hello") as! popupViewController
popupVC.modalPresentationStyle = .Popover
popupVC.preferredContentSize = CGSizeMake(300, 300)
let pVC = popupVC.popoverPresentationController
pVC?.permittedArrowDirections = .Any
pVC?.delegate = self
pVC?.sourceView = sender
pVC?.sourceRect = CGRect(x: 100, y: 100, width: 1, height: 1)
presentViewController(popupVC, animated: true, completion: nil)
}
}
क्या I'am गलत कर: यहाँ मेरी कोड है?