Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created October 26, 2014 04:22
Show Gist options
  • Save angelsystem/efb896ff501e0facb6e1 to your computer and use it in GitHub Desktop.
Save angelsystem/efb896ff501e0facb6e1 to your computer and use it in GitHub Desktop.
spinner swift IOs
//
// 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