Я хочу представить свой popover в другом месте. По умолчанию он начинается там, где пользователь выбирает кнопку. Я использую UIViewController вместо UIPopoverController потому UIPopoverController осуждается в iOS9popover изменение положение начальная точка (изначальный местонахождение) iOS9
class CustomPop: UIViewController, UIPopoverPresentationControllerDelegate {
init() {
super.init(nibName: nil, bundle: nil)
self.modalPresentationStyle = UIModalPresentationStyle.Popover;
self.popoverPresentationController?.delegate = self;
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle{
return .None
}
}
//for example something like this but I need it for a popover:
custom = CustomPop()
custom.frame.origin.y = self.view.height - 100
// is there a way to use CGRectMake for the popover to accomplish this?
вы хотите поповер быть в точном месте или, возможно, вы хотите стрелка должна быть слева от размера popover или посередине или слева или что-то в этом роде? – Korpel