Simple loading animation using squares
let loadingSquare = AASquaresLoading(target: self.view, size: 40)
// Customize background
loadingSquare.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.4)
// Customize color
loadingSquare.color = UIColor.whiteColor()
// Start loading
loadingSquare.start()
....
// Stop loading
loadingSquare.stop()
More examples in the demo project.
- Add to your podfile :
pod 'AASquaresLoading'
- In your terminal :
pod install
- Add
AASquaresLoading.swift
to your project - That's all you can use it!
-
As a UIView method
self.view.squareLoading.start(0.0) ... self.view.squareLoading.stop(0.0)
-
As a standalone class
let loadingSquare = AASquaresLoading(target: self.view, size: 40) loadingSquare.start() .... loadingSquare.stop()
-
As a custom class interface builder by setting AASquareLoading as a custom class for a UIView
self.view.squareLoading.backgroundColor = UIColor.redColor()
self.view.squareLoading.color = UIColor.whiteColor()
self.view.squareLoading.setSquareSize(120)
The MIT License (MIT)
Copyright (c) 2015 Anas AIT-ALI
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.