 			container.translatesAutoresizingMaskIntoConstraints = false
 			scrollView.addSubview(container)
 		}
-		DispatchQueue.main.async {
-			self.scrollView.addObserver(self, forKeyPath: "bounds", options: .new, context: nil)
+		dispatch_async(dispatch_get_main_queue()) {
+			self.scrollView.addObserver(self, forKeyPath: "bounds", options: .New, context: nil)
 		}
 	}
 


extension PageViewController {//MARK: frame calculation

	private func pageForFrame(_ frame: CGRect) -> CGFloat {
		let rect = rectClass.init(frame)
		return rect.size.relevant == 0 ? -9999999 : rect.origin.relevant / rect.size.relevant
	}

	private func frameForPage(_ page: Int) -> CGRect {
		let frame = rectClass.init(scrollView.bounds)
		frame.origin.relevant = frame.size.relevant * CGFloat(page)
		return frame.rect

			if let container = attachView(viewController.view) {
				addChildViewController(viewController)
				container.frame = frameForPage(page)
				viewController.didMoveToParentViewController(self)
			}
		}
	}

	private func detachViewController(viewController: UIViewController) {

		if let view = viewController.view {
			view.superview?.frame = rectClass.offscreen
			viewController.willMoveToParentViewController(nil)
			view.removeFromSuperview()
			viewController.removeFromParentViewController()
		}
	}

	private func attachView(childView: UIView, offscreen: UIView? = nil) -> UIView? {

		guard let container = offscreen ?? offscreenView() else {
			return nil
