 	fileprivate var currentWebViewScrollPositions = [Int: CGPoint]()
 	fileprivate var currentOrientation: UIInterfaceOrientation?
     
+    // MARK: - Init
+    
+    init() {
+        super.init(nibName: nil, bundle: Bundle.frameworkBundle())
+        initialization()
+    }
+    
+    required public init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+        initialization()
+    }
+    
+    /**
+     Common Initialization
+     */
+    fileprivate func initialization() {
+        
+        if (readerConfig.hideBars == true) {
+            self.pageIndicatorHeight = 0
+        }
+        
+        totalPages = book.spine.spineReferences.count
+        
+        // Loading indicator
+        let style: UIActivityIndicatorViewStyle = isNight(.white, .gray)
+        loadingView = UIActivityIndicatorView(activityIndicatorStyle: style)
+        loadingView.hidesWhenStopped = true
+        loadingView.startAnimating()
+        view.addSubview(loadingView)
+    }
+    
     // MARK: - View life cicle
     
     override open func viewDidLoad() {
         super.viewDidLoad()
-
-        if (readerConfig.hideBars == true) {
-			self.pageIndicatorHeight = 0
-        }
-
+        
         screenBounds = self.view.frame
         setPageSize(UIApplication.shared.statusBarOrientation)
         


		// Page indicator view
		pageIndicatorView = FolioReaderPageIndicator(frame: self.frameForPageIndicatorView())
		if let _pageIndicatorView = pageIndicatorView {
			view.addSubview(_pageIndicatorView)
		}

		scrollScrubber = ScrollScrubber(frame: self.frameForScrollScrubber())
		scrollScrubber?.delegate = self

		if let _scrollScruber = scrollScrubber {
			view.addSubview(_scrollScruber.slider)
		}
        
        // Loading indicator
        let style: UIActivityIndicatorViewStyle = isNight(.white, .gray)
        loadingView = UIActivityIndicatorView(activityIndicatorStyle: style)
        loadingView.hidesWhenStopped = true
        loadingView.startAnimating()
        view.addSubview(loadingView)
    }
    
    override open func viewWillAppear(_ animated: Bool) {

        // Register cell classes
        collectionView!.register(FolioReaderPage.self, forCellWithReuseIdentifier: reuseIdentifier)
        
        // Configure navigation bar and layout
        automaticallyAdjustsScrollViewInsets = false
        extendedLayoutIncludesOpaqueBars = true
