         scrollView.alwaysBounceVertical = true
         scrollView.isScrollEnabled = true
         scrollView.accessibilityLabel = "PhotoSliderScrollView"
+        return scrollView
+    }()
+    
+    var imageURLs: [URL]?
+    var images: [UIImage]?
+    var photos: [PhotoSlider.Photo]?
+    var usingImageType: PhotoSliderControllerUsingImageType = .None
+
+    lazy var backgroundView: UIView = {
+        let backgroundView = UIView(frame: self.view.bounds)
+        backgroundView.backgroundColor = self.backgroundViewColor
+        return backgroundView
+    }()
+
+    lazy var effectView: UIVisualEffectView = {
+        let effectView = UIVisualEffectView(effect: UIBlurEffect(style: .dark))
+        effectView.frame = self.view.bounds
+        return effectView
+    }()
+
+    var closeButton: UIButton?
+    
+    var scrollMode: PhotoSliderControllerScrollMode = .None
+    var scrollInitalized = false
+    var closeAnimating = false
+    var imageViews: [PhotoSlider.ImageView] = []
+    var previousPage = 0
+    var captionLabel = UILabel(frame: CGRect.zero)
+
+    // For ScrollViewDelegate
+    var scrollPreviewPoint = CGPoint.zero
+
+    public var delegate: PhotoSliderDelegate?
+    public var visiblePageControl = true
+    public var visibleCloseButton = true
+    public var currentPage = 0
+
+    lazy public var pageControl: UIPageControl = {
+        let pageControl = UIPageControl()
+        pageControl.frame = .zero
+        pageControl.numberOfPages = self.imageResources()!.count
+        pageControl.isUserInteractionEnabled = false
+        return pageControl
+    }()
+    
+    public var backgroundViewColor = UIColor.black
+    public var captionTextColor = UIColor.white
+
+    public var imageLoader: PhotoSlider.ImageLoader?
+
+    public init(imageURLs:Array<URL>) {
+        super.init(nibName: nil, bundle: nil)
+        self.imageURLs = imageURLs
+        usingImageType = .URL
+    }
+
+    public init(images: [UIImage]) {
+        super.init(nibName: nil, bundle: nil)
+        self.images = images
+        usingImageType = .Image
+    }
+
+    public init(photos: [PhotoSlider.Photo]) {
+        super.init(nibName: nil, bundle: nil)
+        self.photos = photos
+        usingImageType = .Photo
+    }
+
+    required public init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+
+    var statusBarHidden = false {
+        didSet {
+            UIView.animate(withDuration: 0.5) {
+                self.setNeedsStatusBarAppearanceUpdate()
+            }
+        }
+    }
+
+    override public var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
+        return .fade
+    }
+
+    override public var prefersStatusBarHidden: Bool {
+        return statusBarHidden
+    }
+    
+    public override func viewDidLoad() {
+        super.viewDidLoad()
+
+        view.frame = UIScreen.main.bounds
+        view.backgroundColor = UIColor.clear
+
+        view.addSubview(effectView)
+        effectView.addSubview(backgroundView)
+
+        // scrollview setting for Item
         view.addSubview(scrollView)
         layoutScrollView()
 


public class ViewController:UIViewController {

    var scrollView: UIScrollView!

    var imageURLs: [URL]?
    var images: [UIImage]?
    var photos: [PhotoSlider.Photo]?
    var usingImageType: PhotoSliderControllerUsingImageType = .None
    var backgroundView: UIView!
    var effectView: UIVisualEffectView!
    var closeButton: UIButton?
    var scrollMode: PhotoSliderControllerScrollMode = .None
    var scrollInitalized = false
    var closeAnimating = false
    var imageViews: [PhotoSlider.ImageView] = []
    var previousPage = 0
    var captionLabel = UILabel(frame: CGRect.zero)

    // For ScrollViewDelegate
    var scrollPreviewPoint = CGPoint.zero

    public var delegate: PhotoSliderDelegate?
    public var visiblePageControl = true
    public var visibleCloseButton = true
    public var currentPage = 0

    public var pageControl = UIPageControl()
    public var backgroundViewColor = UIColor.black
    public var captionTextColor = UIColor.white

    public var imageLoader: PhotoSlider.ImageLoader?

    public init(imageURLs:Array<URL>) {
        super.init(nibName: nil, bundle: nil)
        self.imageURLs = imageURLs
        usingImageType = .URL
    }

    public init(images: [UIImage]) {
        super.init(nibName: nil, bundle: nil)
        self.images = images
        usingImageType = .Image
    }

    public init(photos: [PhotoSlider.Photo]) {
        super.init(nibName: nil, bundle: nil)
        self.photos = photos
        usingImageType = .Photo
    }

    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

    var statusBarHidden = false {
        didSet {
            UIView.animate(withDuration: 0.5) {
                self.setNeedsStatusBarAppearanceUpdate()
            }
        }
    }

    override public var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
        return .fade
    }

    override public var prefersStatusBarHidden: Bool {
        return statusBarHidden
    }
    
    public override func viewDidLoad() {
        super.viewDidLoad()

        view.frame = UIScreen.main.bounds
        view.backgroundColor = UIColor.clear

        backgroundView = UIView(frame: view.bounds)
        backgroundView.backgroundColor = backgroundViewColor

        effectView = UIVisualEffectView(effect: UIBlurEffect(style: .dark))
        effectView.frame = view.bounds
        view.addSubview(effectView)
        effectView.addSubview(backgroundView)

        // scrollview setting for Item
        scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: view.bounds.height))
        scrollView.isPagingEnabled = true
        scrollView.showsHorizontalScrollIndicator = false
        scrollView.showsVerticalScrollIndicator = false

        
        // Page Control
        if visiblePageControl {
            view.addSubview(pageControl)
            layoutPageControl()
        }
