|
1 | | -# Progressable |
| 1 | + |
2 | 2 |
|
3 | | -[](https://travis-ci.org/Matthew Pierce/Progressable) |
4 | | -[](https://cocoapods.org/pods/Progressable) |
5 | | -[](https://cocoapods.org/pods/Progressable) |
6 | | -[](https://cocoapods.org/pods/Progressable) |
| 3 | +[](https://app.bitrise.io/app/e89c0d6172145d37) |
| 4 | +[](https://cocoapods.org/pods/Loadable) |
| 5 | +[](https://cocoapods.org/pods/Loadable) |
| 6 | +[](https://cocoapods.org/pods/Loadable) |
7 | 7 |
|
8 | | -## Example |
| 8 | +## π€ About |
9 | 9 |
|
10 | | -To run the example project, clone the repo, and run `pod install` from the Example directory first. |
| 10 | +Loadable allows you to attach `Progress` to any `UIView` or subclass and then use the `UIView` to display progress. You can animate the progress, set the progress colour and show or hide the percentage progress in the bottom corner of your view. Please see below for demos of Loadable working on a `UIView` and a `UISegmentControl`. |
| 11 | + |
| 12 | +<p align="center"> |
| 13 | + <img src="https://i.imgur.com/g73LOXs.gif"> |
| 14 | + <img src="https://i.imgur.com/g2nBipd.gif"> |
| 15 | +</p> |
11 | 16 |
|
12 | | -## Requirements |
| 17 | +## π Demo |
13 | 18 |
|
14 | | -## Installation |
| 19 | +To run the example project, clone the repo, and run `pod install` from the Example directory first. |
15 | 20 |
|
16 | | -Progressable is available through [CocoaPods](https://cocoapods.org). To install |
| 21 | +## π² Installation |
| 22 | + |
| 23 | +Loadable is available through [CocoaPods](https://cocoapods.org). To install |
17 | 24 | it, simply add the following line to your Podfile: |
18 | 25 |
|
19 | 26 | ```ruby |
20 | | -pod 'Progressable' |
| 27 | +pod 'Loadable' |
21 | 28 | ``` |
22 | 29 |
|
23 | | -## Author |
| 30 | +and run `pod install` |
| 31 | + |
| 32 | +## β
Requirements |
| 33 | +- Swift 5.0 |
| 34 | +- iOS 11.0 |
| 35 | + |
| 36 | +## π©βπ» How to use |
| 37 | + |
| 38 | +Loadable can be used on any `UIView` or subclass. As it is built as an extension of `UIView`, the only thing you need to do to use it is import it at the top of your file. After that you can configure the view you want to use as a loading view with a few different options as follows: |
| 39 | + |
| 40 | +```swift |
| 41 | +let viewToShowLoading: UIView = UIView() |
| 42 | +let progress = Progress(totalUnitCount: 100) |
| 43 | + |
| 44 | +viewToShowLoading.monitoredProgress = progress |
| 45 | + |
| 46 | +// everything from here on is optional configuration. The lines above will setup everything |
| 47 | + |
| 48 | +viewToShowLoading.animateProgrss = true |
| 49 | +viewToShowLoading.progressColor = .blue |
| 50 | +viewToShowLoading.showPercentage = true |
| 51 | +viewToShowLoading.progressPercentageFontSize = 12.0 |
| 52 | +viewToShowLoading.progressPercentageFontColor = .red |
| 53 | +viewToShowLoading.clearOnComplete = false |
| 54 | +``` |
| 55 | + |
| 56 | +As you can see from the comment in the above snippet, all that is necessary to make the `UIView` become a Loadable one is attaching some `Progress` to the new `monitoredProgress` property. After that you can configure the Loadable view any way you like. |
| 57 | + |
| 58 | +## π¨βπ©βπ§βπ¦ Contributing |
| 59 | + |
| 60 | +If you run into any problems, please submit an issue. Pull requests are also welcome! By contributing to Loadable you agree that your contributions will be licensed under its MIT license. |
| 61 | + |
| 62 | +If you use Loadable in your app I'd love to hear from you on [Twitter](https://twitter.com/PierceMatthew)! |
| 63 | + |
| 64 | +## πββοΈ Author |
24 | 65 |
|
25 | | - |
| 66 | +WaveTab was created by Matthew Pierce ([@PierceMatthew](https://twitter.com/PierceMatthew)) |
26 | 67 |
|
27 | | -## License |
| 68 | +## π License |
28 | 69 |
|
29 | | -Progressable is available under the MIT license. See the LICENSE file for more info. |
| 70 | +Loadable is available under the MIT license. See the LICENSE file for more info. |
0 commit comments