         super.init(nibName: nil, bundle: nil)
         self.pagingView.pagingDataSource = self
         self.pagingView.pagingDelegate = self
-        self.view.addSubview(self.pagingView)
     }
     
     required public init?(coder aDecoder: NSCoder) {

    var viewIsDisappeared = false
    var previousPageIndex: Int = 0
    var feedbackGenerator = UISelectionFeedbackGenerator()
    var currentPageHudLabel: UILabel
    var didRotate: Bool = false
    
    private var _doubleSidedConfiguration = DoubleSidedConfiguration(portrait: false, landscape: false)
    public var doubleSidedConfiguration: DoubleSidedConfiguration {


import UIKit

public class PageHud: UIView {
    let label: UILabel
    
    public override init(frame: CGRect) {
        self.label = UILabel(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
        super.init(frame: frame)
        self.widthAnchor.constraint(equalToConstant: frame.width).isActive = true
        self.heightAnchor.constraint(equalToConstant: frame.height).isActive = true
        configureViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func configureViews() {
        clipsToBounds = true
        
        let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .dark))
        blurView.translatesAutoresizingMaskIntoConstraints = false
        addSubview(blurView)
        blurView.widthAnchor.constraint(equalTo: widthAnchor).isActive = true
        blurView.heightAnchor.constraint(equalTo: heightAnchor).isActive = true
        blurView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
        blurView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        
        addSubview(label)
        label.translatesAutoresizingMaskIntoConstraints = false
        label.backgroundColor = UIColor.clear
        layer.cornerRadius = 15
        layer.borderWidth = 1
        layer.borderColor = UIColor.white.cgColor
        label.textColor = UIColor.white
        label.textAlignment = .center
        label.font = UIFont.systemFont(ofSize: RDImageViewerController.pageHudLabelFontSize)
        
        label.widthAnchor.constraint(equalTo: widthAnchor).isActive = true
        label.heightAnchor.constraint(equalTo: heightAnchor).isActive = true
        label.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
        label.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
    }
}

@objcMembers
public class DoubleSidedConfiguration {
    public var portrait: Bool = false
