     optional func didMoveToMenuPage(page: Int)
 }
 
-final public class PagingMenuController: UIViewController, UIScrollViewDelegate {
-    
+public class PagingMenuController: UIViewController, UIScrollViewDelegate {
+
     public weak var delegate: PagingMenuControllerDelegate?
-    private var options: PagingMenuOptions!
+    private var options: PagingMenuOptions = PagingMenuOptions()
     public private(set) var menuView: MenuView!
-    public private(set) var currentPage: Int = 0
-    public private(set) var currentViewController: UIViewController!
-    public private(set) var visiblePagingViewControllers = [UIViewController]()
-    public private(set) var pagingViewControllers = [UIViewController]() {
-        willSet {
-            options.menuItemCount = newValue.count
-        }
-    }
-    
+    public var currentPage: Int {
+        let offsetX = contentScrollView?.contentOffset.x ?? 0
+        let page = Int(offsetX / view.bounds.width)
+
+        if case .Infinite = options.menuDisplayMode {
+            return max(0, page - 1)
+        } else {
+            return page
+        }
+    }
+
+    public var currentViewController: UIViewController? {
+        guard currentPage > pagingViewControllers?.count else { return nil }
+        return pagingViewControllers?[currentPage]
+    }
+
+    public private(set) var pagingViewControllers: [UIViewController]? {
+        didSet {
+            options.menuItemCount = pagingViewControllers?.count ?? 0
+
+            // remove previous childViewContorllers
+            for childViewController in childViewControllers {
+                childViewController.willMoveToParentViewController(nil)
+                childViewController.view.removeFromSuperview()
+                childViewController.removeFromParentViewController()
+                childViewController.didMoveToParentViewController(nil)
+            }
+
+            constructMenuView()
+            layoutMenuView()
+            constructContentScrollView()
+            layoutContentScrollView()
+
+            // add new childViewControllers
+            guard let
+                pagingViewControllers = self.pagingViewControllers,
+                contentScrollView = contentScrollView else { return }
+
+            contentScrollView.backgroundColor = .redColor()
+            let containerWidth = view.bounds.width
+            assert(containerWidth > 0)
+
+            for (page, pagingViewController) in pagingViewControllers.enumerate() {
+                pagingViewController.willMoveToParentViewController(self)
+                addChildViewController(pagingViewController)
+
+                let view = pagingViewController.view
+                contentScrollView.addSubview(view)
+                view.translatesAutoresizingMaskIntoConstraints = false
+
+
+                // constraint Top + Width + Height of pages
+                for attribute in [NSLayoutAttribute.Top, .Width, .Height] {
+                    NSLayoutConstraint(item: view, attribute: attribute, relatedBy: .Equal, toItem: contentScrollView, attribute: attribute, multiplier: 1, constant: 0).active = true
+                }
+
+                // constraint leading of first page to superview
+                let toItem: UIView
+                let toAttribute: NSLayoutAttribute
+                let constant: CGFloat
+
+                if page == 0 {
+                    toItem = contentScrollView
+                    toAttribute = .Leading
+
+                    if case .Infinite = options.menuDisplayMode {
+                        constant = containerWidth
+                    } else {
+                        constant = 0
+                    }
+                } else {
+                    let previousPage = page - 1
+                    toItem = pagingViewControllers[previousPage].view
+                    toAttribute = .Trailing
+                    constant = 0
+                }
+
+                NSLayoutConstraint(item: view, attribute: .Leading, relatedBy: .Equal, toItem: toItem, attribute: toAttribute, multiplier: 1, constant: constant).active = true
+
+                pagingViewController.didMoveToParentViewController(self)
+            }
+
+            var pageCount = pagingViewControllers.count
+            if case .Infinite = options.menuDisplayMode {
+                pageCount += 2 // add space for front and back copy of views
+            }
+
+            contentScrollView.contentSize.width = CGFloat(pageCount) * containerWidth
+        }
+    }
+
     private var contentScrollView: UIScrollView!
-    private var contentView: UIView!
     private var menuItemTitles: [String] {
         get {
-            return pagingViewControllers.map {
-                return $0.title ?? "Menu"
-            }
+            guard let pagingViewControllers = pagingViewControllers else { return [] }
+            return pagingViewControllers.map { return $0.title ?? "Menu" }
         }
     }
     private enum PagingViewPosition {
         case Left
         case Center
         case Right
-        case Unknown
-
-        init(order: Int) {
+
+        init?(order: Int) {
             switch order {
             case 0: self = .Left
             case 1: self = .Center
             case 2: self = .Right
-            default: self = .Unknown
-            }
-        }
-    }
-    private var currentPosition: PagingViewPosition = .Left
+            default: return nil
+            }
+        }
+    }
+
     private let visiblePagingViewNumber: Int = 3
     private var previousIndex: Int {
         guard case .Infinite = options.menuDisplayMode else { return currentPage - 1 }
-        
+
         return currentPage - 1 < 0 ? options.menuItemCount - 1 : currentPage - 1
     }
     private var nextIndex: Int {
         guard case .Infinite = options.menuDisplayMode else { return currentPage + 1 }
-        
+
         return currentPage + 1 > options.menuItemCount - 1 ? 0 : currentPage + 1
     }
 
     private let ExceptionName = "PMCException"
 
     // MARK: - Lifecycle
-    
-    public init(viewControllers: [UIViewController], options: PagingMenuOptions) {
+
+    public init(viewControllers: [UIViewController], options: PagingMenuOptions? = nil) {
+        if let options = options {
+            self.options = options
+        }
+
         super.init(nibName: nil, bundle: nil)
-        
-        setup(viewControllers: viewControllers, options: options)
-    }
-    
-    convenience public init(viewControllers: [UIViewController]) {
-        self.init(viewControllers: viewControllers, options: PagingMenuOptions())
+        setup(viewControllers: viewControllers)
     }
 
     required public init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)
     }
-    
+
     public override func viewWillAppear(animated: Bool) {
         super.viewWillAppear(animated)
-        
+
         // position properly for Infinite mode
         menuView.moveToMenu(page: currentPage, animated: false)
     }
-    
+
     override public func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
-        
+
         // fix unnecessary inset for menu view when implemented by programmatically
         menuView.contentInset.top = 0
 

            contentScrollView.contentOffset.x = currentViewController.view!.frame.minX
        }
    }
    
    override public func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
        
        menuView.updateMenuViewConstraints(size: size)
        
        coordinator.animateAlongsideTransition({ [unowned self] (_) -> Void in
            self.view.setNeedsLayout()
            self.view.layoutIfNeeded()
            
            // reset selected menu item view position
            switch self.options.menuDisplayMode {
            case .Standard, .Infinite:
                self.menuView.moveToMenu(page: self.currentPage, animated: true)
            default: break
            }
        }, completion: nil)
    }
    
    public func setup(viewControllers viewControllers: [UIViewController], options: PagingMenuOptions) {
        self.options = options
        pagingViewControllers = viewControllers
        visiblePagingViewControllers.reserveCapacity(visiblePagingViewNumber)
        
        // validate
        validateDefaultPage()
        validatePageNumbers()
        
        // cleanup
        cleanup()
        
        currentPage = options.defaultPage
        
        constructMenuView()
        constructContentScrollView()
        layoutMenuView()
        layoutContentScrollView()
        constructContentView()
        layoutContentView()
        constructPagingViewControllers()
        layoutPagingViewControllers()

        currentPosition = currentPagingViewPosition()
        currentViewController = pagingViewControllers[currentPage]
        moveToMenuPage(currentPage, animated: false)
    }
    
    public func rebuild(viewControllers: [UIViewController], options: PagingMenuOptions) {
        // cleanup properties to avoid memory leaks. This could also be placed inside the cleanup method, or in within didSet{} of the pagingViewController
        visiblePagingViewControllers.removeAll()
        currentViewController = nil
        
        for childViewController in childViewControllers {
            childViewController.view.removeFromSuperview()
            childViewController.removeFromParentViewController()
        }

        // perform setup
        
        setup(viewControllers: viewControllers, options: options)
        
        view.setNeedsLayout()
        view.layoutIfNeeded()
    }
    
    // MARK: - UISCrollViewDelegate
    
    public func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
        guard scrollView.isEqual(contentScrollView) else { return }

        let position = currentPagingViewPosition()
        
        // set new page number according to current moving direction
        switch position {
        case .Left: currentPage = previousIndex
        case .Right: currentPage = nextIndex
        default: return
        }

        delegate?.willMoveToMenuPage?(currentPage)
        menuView.moveToMenu(page: currentPage, animated: true)
        currentViewController = pagingViewControllers[currentPage]
        contentScrollView.contentOffset.x = currentViewController.view!.frame.minX

        constructPagingViewControllers()
        layoutPagingViewControllers()
        view.setNeedsLayout()
        view.layoutIfNeeded()

        currentPosition = currentPagingViewPosition()
        delegate?.didMoveToMenuPage?(currentPage)
    }
    
    // MARK: - UIGestureRecognizer
    
    internal func handleTapGesture(recognizer: UITapGestureRecognizer) {
        let tappedMenuView = recognizer.view as! MenuItemView
        guard let tappedPage = menuView.menuItemViews.indexOf(tappedMenuView) where tappedPage != currentPage else { return }
        
        let page = targetPage(tappedPage: tappedPage)
        moveToMenuPage(page, animated: true)
    }
    
    internal func handleSwipeGesture(recognizer: UISwipeGestureRecognizer) {
        var newPage = currentPage
        if recognizer.direction == .Left {

        } else {
            return
        }

        moveToMenuPage(newPage, animated: true)
    }

    // MARK: - Constructor

    private func constructMenuView() {
        menuView?.removeFromSuperview()
        menuView = MenuView(menuItemTitles: menuItemTitles, options: options)
        menuView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(menuView)

        addTapGestureHandlers()
        addSwipeGestureHandlersIfNeeded()
    }

    private func layoutMenuView() {
        NSLayoutConstraint(item: menuView, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: options.menuHeight).active = true

        for edge in [NSLayoutAttribute.Leading, .Trailing, options.menuPosition.layoutAttribute] {
            NSLayoutConstraint(item: menuView, attribute: edge, relatedBy: .Equal, toItem: menuView.superview, attribute: edge, multiplier: 1, constant: 0).active = true
        }
    }

    private func constructContentScrollView() {
        contentScrollView?.removeFromSuperview()
        contentScrollView = UIScrollView(frame: CGRectZero)
        contentScrollView.delegate = self
        contentScrollView.pagingEnabled = true
        contentScrollView.showsHorizontalScrollIndicator = false
        contentScrollView.showsVerticalScrollIndicator = false
        contentScrollView.scrollsToTop = false
        contentScrollView.bounces = true
        contentScrollView.scrollEnabled = options.scrollEnabled
        contentScrollView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(contentScrollView)
    }

    private func layoutContentScrollView() {
        guard let contentScrollView = contentScrollView where contentScrollView.superview != nil,
            let menuView = menuView else { return }

        for edge in [NSLayoutAttribute.Leading, .Bottom, .Trailing] {
            NSLayoutConstraint(item: contentScrollView, attribute: edge, relatedBy: .Equal, toItem: contentScrollView.superview, attribute: edge, multiplier: 1, constant: 0).active = true
        }

        NSLayoutConstraint(item: contentScrollView, attribute: .Top, relatedBy: .Equal, toItem: menuView, attribute: .Bottom, multiplier: 1, constant: 0).active = true
    }


    // MARK: - Gesture handler

    private func addTapGestureHandlers() {
        menuView.menuItemViews.forEach { $0.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "handleTapGesture:")) }
    }

    private func addSwipeGestureHandlersIfNeeded() {
        switch options.menuDisplayMode {
        case .Standard(_, _, .PagingEnabled): break
