         multiplier: 1, constant: 0))
     }
     
-    let config = LightboxConfig.sharedInstance.config
-
     view.addConstraint(NSLayoutConstraint(item: pageLabel, attribute: .Leading,
       relatedBy: .Equal, toItem: view, attribute: .Leading,
       multiplier: 1, constant: 0))

  
  public override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(true)
    let config = LightboxConfig.sharedInstance.config
    
    if config.hideStatusBar {
      UIApplication.sharedApplication().setStatusBarHidden(true,


public class LightboxController: UIViewController {

  public var delegate: LightboxControllerDelegate?
  var images = [String]()
  var collectionSize = CGSizeZero
  var config: Config {
    return LightboxConfig.sharedInstance.config
  }

  public private(set) var page = 0 {
    didSet {
      let text = "\(page + 1)/\(images.count)"
      
      pageLabel.attributedText = NSAttributedString(string: text,
        attributes: config.pageIndicator.textAttributes)
      pageLabel.sizeToFit()

      delegate?.lightboxControllerDidMoveToPage(self, page: page)
