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

Commit ee27739

Browse files
author
andrewlloyd100
authored
Merge pull request #12 from nodes-ios/ReadMe
New ReadME
2 parents 31ee2e8 + 1ad7a2d commit ee27739

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
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+
14+
## 🔧 Setup
15+
Easily present spinners in views like so:
16+
```swift
17+
let spinner = SpinnerView.showSpinnerInView(self.view)
18+
```
19+
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.
20+
```swift
21+
public static func showSpinnerInView(view: UIView, style: UIActivityIndicatorViewStyle = .White, color:UIColor? = nil, disablesUserInteraction: Bool = false) -> Spinner
22+
```
23+
Example of adding it to a view.
24+
```swift
25+
let spinner = SpinnerView.showSpinnerInView(self.view, style: UIActivityIndicatorViewStyle.White, color: UIColor.redColor(), disablesUserInteraction: false)
26+
```
27+
28+
To remove the spinner from your view simply call dismiss.
29+
```swift
30+
spinner.dismiss()
31+
```
32+
33+
----
34+
## Custom spinner
35+
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.
36+
```swift
37+
public static func setCustomImages(images: [UIImage], duration: NSTimeInterval)
38+
39+
public static func showCustomSpinnerInView(view: UIView)
40+
```
41+
----
42+
## Buttons
43+
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.
44+
45+
```swift
46+
public static func showCustomSpinnerInButton(button: UIButton, disablesUserInteraction:Bool = true) -> Spinner
47+
```
48+
49+
## Credits
50+
Made with ❤️ at [Nodes](http://nodesagency.com).
51+
52+
## 📄 License
53+
**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)