       return (self?.rx_observe(Int.self, "_selectedIndex") ?? Observable.empty())
         .map { index in
           index ?? 0
-        }
+      }
     }
 
     let bindingObserver = UIBindingObserver(UIElement: self) {

    }
  }

  public var pageViewControllers: [UIViewController] = [] {
    didSet {
      guard let firstViewController = pageViewControllers.first else {
        setViewControllers(nil, direction: .Forward, animated: false, completion: nil)
        return
      }
      setViewControllers([firstViewController], direction: .Forward, animated: false,
                         completion: nil)
    }
  }

  public var pageViewControllerDelegate: PageViewControllerDelegate?

  override init(transitionStyle style: UIPageViewControllerTransitionStyle,
                                navigationOrientation: UIPageViewControllerNavigationOrientation,
                                options: [String : AnyObject]?) {
    super.init(transitionStyle: style, navigationOrientation: navigationOrientation,
               options: options)
    commonSetup()


  public override func viewDidLoad() {
    super.viewDidLoad()
    performPageSegues()
  }

  // A very hacky way to automatically perform segues defined in the storyboard
  // storyboardSegueTemplates has a property named segueClassName which contains the mangled name
  // for the Segue's class e.g. 't3gdxPageSegue'; it also has the identifier property to perform
  // the segue with identifier call.
  private func performPageSegues() {
    guard let segueTemplates = valueForKey("storyboardSegueTemplates") as? [AnyObject] else {
      return
    }

    segueTemplates
      .filter {
        ($0.valueForKey("segueClassName") as? String)?.containsString("PageSegue") ?? false
      }.flatMap { $0.valueForKey("identifier") as? String }
      .forEach { self.performSegueWithIdentifier($0, sender: nil) }
  }

  public func setSelectedIndex(index: Int, animated: Bool) {
