         //判断类型
         if newSuperview is UIScrollView {
             //记录父控件
-            self.scrollview = newSuperview as! UIScrollView
+            self.scrollview = newSuperview as? UIScrollView
             //添加观察者
             self.scrollview?.addObserver(self, forKeyPath: "contentOffset", options: [.new], context: nil)
         }

        //添加下拉刷新的控件
        addSubview(arrowIcon)
        addSubview(messageLabel)
        
        //约束
        arrowIcon.snp_makeConstraints { (make ) in

        messageLabel.text = "等待起飞"
        return messageLabel
    }()
    
    //菊花转
    lazy var indicatorView :UIActivityIndicatorView = {
        
        let indicatorView = UIActivityIndicatorView()
        indicatorView.color = UIColor.black
        indicatorView.isHidden = true
        return indicatorView
    }()


}
