Created
October 26, 2014 04:22
-
-
Save angelsystem/efb896ff501e0facb6e1 to your computer and use it in GitHub Desktop.
spinner swift IOs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// spiner-alert | |
// | |
// Created by Angelito Rojas on 25/10/14. | |
// Copyright (c) 2014 Angelito Rojas. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { | |
var activityIndicator:UIActivityIndicatorView = UIActivityIndicatorView() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
@IBAction func pause(sender: AnyObject) { | |
activityIndicator = UIActivityIndicatorView(frame: CGRectMake(0, 0, 50, 50)) | |
activityIndicator.center = self.view.center | |
activityIndicator.hidesWhenStopped = true | |
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray | |
view.addSubview(activityIndicator) | |
activityIndicator.startAnimating() | |
// UIApplication.sharedApplication().beginIgnoringInteractionEvents() | |
} | |
@IBAction func restore(sender: AnyObject) { | |
activityIndicator.stopAnimating() | |
// UIApplication.sharedApplication().endIgnoringInteractionEvents() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment