     // MARK: Public methods
 
     public func addPage(view: UIView) {
-        let bounds = UIScreen.mainScreen().bounds
+        let bounds = UIScreen.mainScreen().liveBounds()
 
         self.scrollView.contentSize = CGSizeMake(
             self.scrollView.contentSize.width + self.scrollView.bounds.size.width,

import UIKit

let TutorialPageControlHeight: CGFloat = 37.0


public class TutorialViewController : UIViewController,UIScrollViewDelegate {

    let TutorialDeviceRotatedNotification = "deviceDidRotate"

    private var scrollView: UIScrollView = {
        let bounds = UIScreen.mainScreen().bounds
        let frame = CGRectMake(0.0, 0.0, bounds.size.width, bounds.size.height)
        let scrollView = UIScrollView(frame: bounds)

        scrollView.pagingEnabled = true
        scrollView.showsHorizontalScrollIndicator = false
        scrollView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight

    }

    private func invalidateLayout() {
        let bounds = UIScreen.mainScreen().liveBounds()
        var index = 0
        var heightOffset: CGFloat = 0.0

        if let navigationBar = self.navigationController?.navigationBar {
            heightOffset += navigationBar.frame.origin.y
            heightOffset += navigationBar.frame.size.height
        }

        for subView in self.scrollView.subviews {
            var view = subView as! UIView
            var frame = view.frame

            if index > 0 {
                frame.origin.x = bounds.size.width * CGFloat(index)
            }

            frame.size.width = bounds.size.width
            frame.size.height = self.scrollView.frame.size.height
            view.frame = frame
            ++index
        }

        self.scrollView.contentSize = CGSizeMake(
            bounds.size.width * CGFloat(index - 1),
            bounds.size.height - heightOffset
        );

        self.scrollToPageWithIndex(self.pageControl.currentPage)
    }

    private func scrollToPageWithIndex(pageIndex: Int) {
        let bounds = UIScreen.mainScreen().liveBounds()
        let view = self.scrollView.subviews[pageIndex] as! UIView
        self.scrollView.scrollRectToVisible(view.frame, animated: true)
    }
}
