                         verticalLayout = false
                     }
                 }
-                
+
                 if !verticalLayout {
                     let action1 = newOrderActions[1]
                     action1.buttonWrapView.frame = CGRect(x: 0, y: contentOriginY + PixelOne, width: buttonScrollView.bounds.width / 2, height: alertButtonHeight)

        maskView.addTarget(self, action: #selector(handleMaskViewEvent(_:)), for: .touchUpInside)
        return maskView
    }()
    
    private lazy var scrollWrapView: UIView = {
        return UIView()
    }()
    
    private lazy var headerScrollView: UIScrollView = {
        return UIScrollView()
    }()
    
    private lazy var buttonScrollView: UIScrollView = {
        return UIScrollView()
    }()
    
    private lazy var headerEffectView: UIView = {
        return UIView()
    }()
    
    private lazy var cancelButtoneEffectView: UIView = {
        return UIView()
    }()
    
    private lazy var extendLayer: CALayer = {
        var extendLayer = CALayer()
        extendLayer.isHidden = !isExtendBottomLayout
        extendLayer.qmui_removeDefaultAnimations()
        return extendLayer
    }()
    
    private var titleLabel: UILabel?
    
    private var messageLabel: UILabel?
    
    private var cancelAction: QMUIAlertAction?
    
    private lazy var alertActions: [QMUIAlertAction] = {
        return []
    }()
    
    private lazy var destructiveActions: [QMUIAlertAction] = {
        return []
    }()
    
    private lazy var alertTextFields: [UITextField] = {
        return []
    }()
    
    private var keyboardHeight: CGFloat = 0
    
    private var isShowing: Bool = false
    
    // 保护 showing 的过程中调用 hide 无效
    private var isNeedsHideAfterAlertShowed: Bool?
    
    private var isAnimatedForHideAfterAlertShowed: Bool?
    
    private var _needsUpdateAction: Bool = false
    
    private var _needsUpdateTitle: Bool = false
    
    private var _needsUpdateMessage: Bool = false
    
    static var alertControllerCount:UInt = 0
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nil, bundle: nil)
        didInitialized()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        didInitialized()
    }
    
    convenience init(title: String?, message: String? = nil, preferredStyle: QMUIAlertControllerStyle) {
        self.init(nibName: nil, bundle: nil)
        self.title = title;
        self.message = message;
        self.preferredStyle = preferredStyle;
        
        updateHeaderBackgrondColor()
        updateEffectBackgroundColor()
        updateCornerRadius()
        updateExtendLayerAppearance()
    }
    
    private func didInitialized() {
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.addSubview(maskView)
        view.addSubview(containerView)
        containerView.addSubview(scrollWrapView)

                    action2.buttonWrapView.frame = CGRect(x: action1.buttonWrapView.frame.maxX + PixelOne, y: contentOriginY + PixelOne, width: buttonScrollView.bounds.width / 2 - PixelOne, height: alertButtonHeight)
                    contentOriginY = action1.buttonWrapView.frame.maxY
                } else {
                    for i in 0 ..< newOrderActions.count {
                        let action = newOrderActions[i]
                        action.buttonWrapView.frame = CGRect(x: 0, y: contentOriginY + PixelOne, width: containerView.bounds.width, height: alertButtonHeight - PixelOne)
                        contentOriginY = action.buttonWrapView.frame.maxY
