刷新控件UIActivityIndicatorView

// MARK: - 初始化 UIActivityIndicatorView 加载视图
    func setupActivity() {
        //加载
        let spinner = UIActivityIndicatorView()
        spinner.activityIndicatorViewStyle = .gray
        spinner.center = view.center
        spinner.hidesWhenStopped = true
        view.addSubview(spinner)
        self.spinner = spinner

//开始刷新
        spinner.startAnimating()
    }
//加载数据完成时,结束刷新
self.spinner.stopAnimating()

你可能感兴趣的:(刷新控件UIActivityIndicatorView)