|
| 1 | +# SDNetworkActivityIndicator |
| 2 | + |
| 3 | +Handle showing / hiding of the iOS network activity indicator to allow multiple concurrent threads to show / hide the indicator such that the indicator remains visible until all the requests have completed and requested the indicator to be hidden. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +* iOS 5.0 or later. |
| 8 | +* ARC memory management. |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +The easiest way to install it is by copying the following files to your project: |
| 13 | + |
| 14 | +* SDNetworkActivityIndicator.h |
| 15 | +* SDNetworkActivityIndicator.m |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +* When you start a network activity (will show the network activity indicator): |
| 20 | + |
| 21 | + [[SDNetworkActivityIndicator sharedActivityIndicator] startActivity]; |
| 22 | + |
| 23 | +* When you finish a network activity (will hide the network activity indicator only if the number of calls to `stopActivity` matches the number of calls to `startActivity`): |
| 24 | + |
| 25 | + [[SDNetworkActivityIndicator sharedActivityIndicator] stopActivity]; |
| 26 | + |
| 27 | +* To hide the network activity indicator regardless of whether all activities have finished (without having to call `stopActivity` for each `startActivity` called): |
| 28 | + |
| 29 | + [[SDNetworkActivityIndicator sharedActivityIndicator] stopAllActivity]; |
| 30 | + |
| 31 | + |
| 32 | +## License |
| 33 | +Copyright (c) 2010 Olivier Poitrey <rs@dailymotion.com> |
| 34 | + |
| 35 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 36 | +of this software and associated documentation files (the "Software"), to deal |
| 37 | +in the Software without restriction, including without limitation the rights |
| 38 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 39 | +copies of the Software, and to permit persons to whom the Software is furnished |
| 40 | +to do so, subject to the following conditions: |
| 41 | + |
| 42 | +The above copyright notice and this permission notice shall be included in all |
| 43 | +copies or substantial portions of the Software. |
| 44 | + |
| 45 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 46 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 47 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 48 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 49 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 50 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 51 | +THE SOFTWARE. |
| 52 | + |
0 commit comments