首页 > 代码库 > UIActivityIndicatorView 风火轮

UIActivityIndicatorView 风火轮

//

//  ActivityIndicatorViewController.swift

//  UIControlDemo

//

//  Created by   on 14/12/1.

//  Copyright (c) 2014 马大哈. All rights reserved.

//

 

import UIKit

 

class ActivityIndicatorViewController: BaseViewController {

    

    var waitActivity:UIActivityIndicatorView?

    

    override func viewDidLoad() {

        super.viewDidLoad()

        self.view.backgroundColor = .redColor()

 

        waitActivity = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge)

        waitActivity?.center = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2)

        self.view.addSubview(waitActivity!)

        

    }

    

    override func viewWillAppear(animated: Bool) {

        waitActivity?.startAnimating()

    }

    

    override func viewDidDisappear(animated: Bool) {

        waitActivity?.stopAnimating()

    }

 

    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.

    }

 

}

UIActivityIndicatorView 风火轮