Merge pull request #5232 from igrechuhin/welcome

[welcome] [ios] Fixed welcome controller crash.
This commit is contained in:
Vlad Mihaylenko 2017-01-19 13:50:08 +03:00 committed by GitHub
commit 2098dcc504

View file

@ -21,10 +21,13 @@ final class WelcomePageController: UIPageViewController {
return viewControllers?.first
}
set {
guard let controller = newValue else { return }
guard let controller = newValue, let parentView = parentController.view else { return }
let animated = !isAnimatingTransition
parentView.isUserInteractionEnabled = isAnimatingTransition
setViewControllers([controller], direction: .forward, animated: animated) { [weak self] _ in
self?.isAnimatingTransition = false
guard let s = self else { return }
s.isAnimatingTransition = false
parentView.isUserInteractionEnabled = true
}
isAnimatingTransition = animated
}
@ -46,9 +49,9 @@ final class WelcomePageController: UIPageViewController {
override func viewDidLoad() {
super.viewDidLoad()
let parentView = parentController.view!
view.backgroundColor = UIColor.white()
if IPAD() {
let parentView = parentController.view!
iPadBackgroundView = SolidTouchView(frame: parentView.bounds)
iPadBackgroundView!.backgroundColor = UIColor.fadeBackground()
iPadBackgroundView!.autoresizingMask = [.flexibleWidth, .flexibleHeight]