Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit 949da67

Browse files
author
Andrew Lloyd
committed
New ReadME
1 parent 31ee2e8 commit 949da67

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
# Spinner
1+
# Spinner
2+
> Present loading indicators anywhere quickly and easily
3+
4+
A helpful loading spinner tool allowing you to present a UIActivityIndicator view directly in to views and buttons.
5+
6+
## 📦 Installation
7+
8+
### Carthage
9+
~~~
10+
github "nodes-ios/Spinner"
11+
~~~
12+
13+
### CocoaPods
14+
~~~
15+
pod 'Spinner', '~> 1.0'
16+
~~~
17+
18+
## 🔧 Setup
19+
Easily present spinners in views like so:
20+
```swift
21+
let spinner = SpinnerView.showSpinnerInView(self.view)
22+
```
23+
Spinner also gives you the option to customise the UIActivityIndicator Style, color and whether it should disable user interaction of the passed view. These optional parameters will be set as the following if not set.
24+
```swift
25+
public static func showSpinnerInView(view: UIView, style: UIActivityIndicatorViewStyle = .White, color:UIColor? = nil, disablesUserInteraction: Bool = false) -> Spinner
26+
```
27+
Example of adding it to a view.
28+
```swift
29+
let spinner = SpinnerView.showSpinnerInView(self.view, style: UIActivityIndicatorViewStyle.White, color: UIColor.redColor(), disablesUserInteraction: false)
30+
```
31+
32+
To remove the spinner from your view simply call dismiss.
33+
```swift
34+
spinner.dismiss()
35+
```
36+
37+
----
38+
## Custom Images spinner
39+
If you would rather use something more custom than the UIActivityIndicator, you can set an array of images to the Spinner with a duration time it takes to animate through them and display it in a view.
40+
```swift
41+
public static func setCustomImages(images: [UIImage], duration: NSTimeInterval)
42+
43+
public static func showCustomSpinnerInView(view: UIView)
44+
```
45+
----
46+
## Buttons
47+
You can also display the spinner in buttons, simply add the spinner to any UIButton and the spinner will hide the title in the button and display the spinner in the centre of the button. Once the spinner is dismissed, the title will be made visible once more.
48+
49+
```swift
50+
public static func showCustomSpinnerInButton(button: UIButton, disablesUserInteraction:Bool = true) -> Spinner
51+
```
52+
53+
Credits
54+
Made with ❤️ at [Nodes](http://nodesagency.com).
55+
56+
## 📄 License
57+
**Spinner** is available under the MIT license. See the [LICENSE](https://github.com/nodes-ios/Spinner/blob/master/LICENSE) file for more info.

0 commit comments

Comments
 (0)