# SVProgressHUD
![Pod Version](https://img.shields.io/cocoapods/v/SVProgressHUD.svg?style=flat)
![Pod License](https://img.shields.io/cocoapods/l/SVProgressHUD.svg?style=flat)
![Pod Platform](https://img.shields.io/cocoapods/p/SVProgressHUD.svg?style=flat)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
`SVProgressHUD` is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS.
![SVProgressHUD](http://f.cl.ly/items/2G1F1Z0M0k0h2U3V1p39/SVProgressHUD.gif)
## Demo
Try `SVProgressHUD` on [Appetize.io](https://appetize.io/app/p8r2cvy8kq74x7q7tjqf5gyatr).
## Installation
### From CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like `SVProgressHUD` in your projects. First, add the following line to your [Podfile](http://guides.cocoapods.org/using/using-cocoapods.html):
```ruby
pod 'SVProgressHUD'
```
If you want to use the latest features of `SVProgressHUD` use normal external source dependencies.
```ruby
pod 'SVProgressHUD', :git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'
```
This pulls from the `master` branch directly. We are usually careful about what we push there and this is the version we use ourselves in all of our projects.
Second, install `SVProgressHUD` into your project:
```ruby
pod install
```
### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```
To integrate `SVProgressHUD` into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "SVProgressHUD/SVProgressHUD"
```
Run `carthage update` to build the framework and drag the built `SVProgressHUD.framework` (in Carthage/Build/iOS folder) into your Xcode project (Linked Frameworks and Libraries in `Targets`).
### Manually
* Drag the `SVProgressHUD/SVProgressHUD` folder into your project.
* Take care that `SVProgressHUD.bundle` is added to `Targets->Build Phases->Copy Bundle Resources`.
* Add the **QuartzCore** framework to your project.
## Usage
(see sample Xcode project in `/Demo`)
`SVProgressHUD` is created as a singleton (i.e. it doesn't need to be explicitly allocated and instantiated; you directly call `[SVProgressHUD method]`).
**Use `SVProgressHUD` wisely! Only use it if you absolutely need to perform a task before taking the user forward. Bad use case examples: pull to refresh, infinite scrolling, sending message.**
Using `SVProgressHUD` in your app will usually look as simple as this (using Grand Central Dispatch):
```objective-c
[SVProgressHUD show];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// time-consuming task
dispatch_async(dispatch_get_main_queue(), ^{
[SVProgressHUD dismiss];
});
});
```
### Showing the HUD
You can show the status of indeterminate tasks using one of the following:
```objective-c
+ (void)show;
+ (void)showWithStatus:(NSString*)string;
```
If you'd like the HUD to reflect the progress of a task, use one of these:
```objective-c
+ (void)showProgress:(CGFloat)progress;
+ (void)showProgress:(CGFloat)progress status:(NSString*)status;
```
### Dismissing the HUD
The HUD can be dismissed using:
```objective-c
+ (void)dismiss;
+ (void)dismissWithDelay:(NSTimeInterval)delay;
```
If you'd like to stack HUDs, you can balance out every show call using:
```objective-c
+ (void)popActivity;
```
The HUD will get dismissed once the `popActivity` calls will match the number of show calls.
Or show a confirmation glyph before before getting dismissed a little bit later. The display time depends on `minimumDismissTimeInterval` and the length of the given string.
```objective-c
+ (void)showInfoWithStatus:(NSString*)string;
+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showErrorWithStatus:(NSString*)string;
+ (void)showImage:(UIImage*)image status:(NSString*)string;
```
## Customization
`SVProgressHUD` can be customized via the following methods:
```objective-c
+ (void)setDefaultStyle:(SVProgressHUDStyle)style; // default is SVProgressHUDStyleLight
+ (void)setDefaultMaskType:(SVProgressHUDMaskType)maskType; // default is SVProgressHUDMaskTypeNone
+ (void)setDefaultAnimationType:(SVProgressHUDAnimationType)type; // default is SVProgressHUDAnimationTypeFlat
+ (void)setMinimumSize:(CGSize)minimumSize; // default is CGSizeZero, can be used to avoid resizing for a larger message
+ (void)setRingThickness:(CGFloat)width; // default is 2 pt
+ (void)setRingRadius:(CGFloat)radius; // default is 18 pt
+ (void)setRingNoTextRadius:(CGFloat)radius; // default is 24 pt
+ (void)setCornerRadius:(CGFloat)cornerRadius; // default is 14 pt
+ (void)setFont:(UIFont*)font; // default is [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]
+ (void)setForegroundColor:(UIColor*)color; // default is [UIColor blackColor], only used for SVProgressHUDStyleCustom
+ (void)setBackgroundColor:(UIColor*)color; // default is [UIColor whiteColor], only used for SVProgressHUDStyleCustom
+ (void)setBackgroundLayerColor:(UIColor*)color; // default is [UIColor colorWithWhite:0 alpha:0.4], only used for SVProgressHUDMaskTypeCustom
+ (void)setInfoImage:(UIImage*)image; // default is the bundled info image provided by Freepik
+ (void)setSuccessImage:(UIImage*)image; // default is bundled success image from Freepik
+ (void)setErrorImage:(UIImage*)image; // default is bundled error image from Freepik
+ (void)setViewForExtension:(UIView*)view; // default is nil, only used if #define SV_APP_EXTENSIONS is set
+ (void)setMinimumDismissTimeInterval:(NSTimeInterval)interval; // default is 5.0 seconds
+ (void)setFadeInAnimationDuration:(NSTimeInterval)duration; // default is 0.15 seconds
+ (void)setFadeOutAnimationDuration:(NSTimeInterval)duration; // default is 0.15 seconds
```
Additionally `SVProgressHUD` supports the `UIAppearance` protocol for most of the above methods.
### Hint
As standard `SVProgressHUD` offers two preconfigured styles:
* `SVProgressHUDStyleLight`: White background with black spinner and text
* `SVProgressHUDStyleDark`: Black background with white spinner and text
If you want to use custom colors with `setForegroundColor` and `setBackgroundColor:` don't forget to set `SVProgressHUDStyleCustom` via `setDefaultStyle:`.
## Notifications
`SVProgressHUD` posts four notifications via `NSNotificationCenter` in response to being shown/dismissed:
* `SVProgressHUDWillAppearNotification` when the show animation starts
* `SVProgressHUDDidAppearNotification` when the show animation completes
* `SVProgressHUDWillDisappearNotification` when the dismiss animation starts
* `SVProgressHUDDidDisappearNotification` when the dismiss animation completes
Each notification passes a `userInfo` dictionary holding the HUD's status string (if any), retrievable via `SVProgressHUDStatusUserInfoKey`.
`SVProgressHUD` also posts `SVProgressHUDDidReceiveTouchEventNotification` when users touch on the overall screen or `SVProgressHUDDidTouchDownInsideNotification` when a user touches on the HUD directly. For this notifications `userInfo` is not passed but the object parameter contains the `UIEvent` that related to the touch.
## App Extensions
When using `SVProgressHUD` in an App Extension, `#define SV_APP_EXTENSIONS` to a
没有合适的资源?快使用搜索试试~ 我知道了~
IOS使用SVGKit库显示svg
共264个文件
h:169个
svn-base:24个
m:16个
4星 · 超过85%的资源 需积分: 48 149 下载量 140 浏览量
2016-11-16
17:49:10
上传
评论 5
收藏 6.5MB ZIP 举报
温馨提示
IOS使用SVGKit库显示svg图demo,并且实现svg图的缩放
资源推荐
资源详情
资源评论
收起资源包目录
IOS使用SVGKit库显示svg (264个子文件)
2.1.1.0edf019 14B
1.2.0.9d54ef7 14B
libSVGKit-iOS.2.0.0.a 9.2MB
all-wcprops 2KB
AMapFoundationKit 2.89MB
AMapLocationKit 1.91MB
CocoaLumberjack 1.97MB
CodeResources 5KB
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
entries 2KB
DDLog.h 24KB
DDFileLogger.h 17KB
SVGKImage.h 14KB
SVProgressHUD.h 9KB
Node.h 8KB
GDataXMLNode.h 7KB
DDTTYLogger.h 7KB
DDDispatchQueueLogFormatter.h 6KB
AMapLocationManager.h 6KB
SVGSVGElement.h 6KB
SVGKit.h 6KB
SVGKPointsAndPathsParser.h 5KB
DDAbstractDatabaseLogger.h 4KB
SVGKParser.h 4KB
CSSPrimitiveValue.h 4KB
Document.h 4KB
DDLog+LOGV.h 4KB
DDLogMacros.h 4KB
DDLegacyMacros.h 3KB
AMapLocationCommonObj.h 3KB
Element.h 3KB
SVGElementInstance.h 3KB
DDContextFilterLogFormatter.h 3KB
SVGKFastImageView.h 3KB
SVGHelperUtilities.h 3KB
SVGElement.h 3KB
AMapLocationRegionObj.h 3KB
SVGLength.h 3KB
SVGDocument.h 2KB
SVGKLayer.h 2KB
SVGTextContentElement.h 2KB
SVGKSource.h 2KB
SVGKParserExtension.h 2KB
SVGKExporterNSData.h 2KB
AMapURLSearchConfig.h 2KB
DDASLLogger.h 2KB
NamedNodeMap.h 2KB
CSSStyleDeclaration.h 2KB
SVGKImage+CGContext.h 2KB
SVGTransform.h 2KB
SVGPreserveAspectRatio.h 2KB
SVGKExporterUIImage.h 2KB
SVGGradientElement.h 2KB
SVGMatrix.h 2KB
MapSvgHelper.h 1KB
DOMHelperUtilities.h 1KB
AMapURLSearchType.h 1KB
DDMultiFormatter.h 1KB
AppleSucksDOMImplementation.h 1KB
SVGKParseResult.h 1KB
CharacterData.h 1KB
CSSRule.h 1KB
SVGAngle.h 1KB
SVGUseElement.h 1KB
SVGRect.h 1KB
AMapUtility.h 1KB
AMapServices.h 1KB
DDAssertMacros.h 1KB
MapTools.h 1KB
SVGSVGElement_Mutable.h 1KB
DDASLLogCapture.h 1KB
SVGRectElement.h 1KB
DocumentType.h 1KB
SVGKImageView.h 1KB
SVGTextPositioningElement.h 1KB
AMapURLSearch.h 1009B
Attr.h 1007B
BaseClassForAllSVGBasicShapes.h 987B
SVGKLayeredImageView.h 959B
CocoaLumberjack.h 931B
CAShapeLayerWithHitTest.h 925B
CSSValue.h 924B
SVGViewSpec.h 893B
CALayerExporter.h 882B
StyleSheet.h 873B
CSSStyleSheet.h 861B
CALayerWithChildHitTest.h 806B
共 264 条
- 1
- 2
- 3
资源评论
- 这杯茶是我的2017-05-27这个库确实可以,内容还有待认识
- leimutian2018-01-09Demo都跑步起来。XCode直接运行就不行。
- harrif2018-04-12下载了,可以用,有一定的参考价值。
- cjw491357452018-12-18测试一下啊
gb_wxzqq
- 粉丝: 22
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 细胞的奇迹:吃出来的免疫力(美亚畅销书!作者的TED演讲播放量超300万次!《谷物大脑》作者、《三联生活周刊》推荐!吃下对的食物,改善你的... (Z-Library).azw3
- 智能手机产品拆解,使用mindmaster打开
- 11111111111111
- 统信系统ARM64依赖openssl-1.0.2版本的libssl.so.10和libcrypto.so.10文件
- 奥比中光python sdk
- 冯超楠17.py
- OCR识别-基于视觉注意力机制Attention实现的OCR识别算法-附项目源码-优质项目实战.zip
- Java 使用蒙特卡洛方法估算PI的近似值(源代码)
- main.cpp
- 电子木鱼小程序源码电子木鱼小程序源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功