Есть несколько способов решить это, я полагаю (теперь, когда я получил его работу).
Простейшим решением является установка рамки на страницеViewController.view для отображения строки состояния.
self.pageViewController.view.frame = CGRectMake(0.0, 20.0, self.view.frame.size.width, self.view.frame.size.height - 20.0)
И поскольку это все, что мне нужно в моей конкретной ситуации, я очень доволен результатом.
Другое решение будет включать программные ограничения (добавления) в представление, к которому вы добавляете pageViewController.view.
override func updateViewConstraints() {
super.updateViewConstraints()
self.pageViewController.view.setTranslatesAutoresizingMaskIntoConstraints(false)
self.view.addConstraint(NSLayoutConstraint(item: self.pageViewController.view, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Top, multiplier: 1.0, constant: 20.0))
self.view.addConstraint(NSLayoutConstraint(item: self.pageViewController.view, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Bottom, multiplier: 1.0, constant: 0.0))
self.view.addConstraint(NSLayoutConstraint(item: self.pageViewController.view, attribute: NSLayoutAttribute.Leading, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Leading, multiplier: 1.0, constant: 0.0))
self.view.addConstraint(NSLayoutConstraint(item: self.pageViewController.view, attribute: NSLayoutAttribute.Trailing, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Trailing, multiplier: 1.0, constant: 0.0))
}
Приведенный выше пример переопределяет функцию updateViewConstraints().
Надеюсь, что это поможет кому-то по пути. Если есть лучшее решение, сообщите мне.
Спасибо!
Браво. Простое решение отлично поработало для меня. – darkheartfelt
Большое спасибо. Спасите мое время .. – torap