修改pods
This commit is contained in:
107
Pods/SVProgressHUD/README.md
generated
107
Pods/SVProgressHUD/README.md
generated
@@ -3,19 +3,29 @@
|
||||

|
||||

|
||||

|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](https://swift.org/package-manager/)
|
||||
[](https://cocoapods.org)
|
||||
[](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.
|
||||
|
||||

|
||||
|
||||
## Demo
|
||||
|
||||
Try `SVProgressHUD` on [Appetize.io](https://appetize.io/app/p8r2cvy8kq74x7q7tjqf5gyatr).
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
[Swift Package Manager](https://swift.org/package-manager/) (SwiftPM) is a tool for managing the distribution of Swift code. It simplifies the process of managing Swift package dependencies.
|
||||
|
||||
To integrate `SVProgressHUD` into your project using SwiftPM:
|
||||
|
||||
1. In Xcode, select **File > Add Package Dependency**.
|
||||
2. Enter the following package repository URL: https://github.com/SVProgressHUD/SVProgressHUD.git
|
||||
3. Choose the appropriate version (e.g. a specific version, branch, or commit).
|
||||
4. Add `SVProgressHUD` to your target dependencies.
|
||||
|
||||
`SVProgressHUD` requires at least Swift tools version 5.3.
|
||||
|
||||
### 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):
|
||||
@@ -56,7 +66,9 @@ Run `carthage bootstrap` to build the framework in your repository's Carthage di
|
||||
|
||||
## Swift
|
||||
|
||||
Even though `SVProgressHUD` is written in Objective-C, it can be used in Swift with no hassle. If you use [CocoaPods](http://cocoapods.org) add the following line to your [Podfile](http://guides.cocoapods.org/using/using-cocoapods.html):
|
||||
Even though `SVProgressHUD` is written in Objective-C, it can be used in Swift with no hassle.
|
||||
|
||||
If you use [CocoaPods](http://cocoapods.org) add the following line to your [Podfile](http://guides.cocoapods.org/using/using-cocoapods.html):
|
||||
|
||||
```ruby
|
||||
use_frameworks!
|
||||
@@ -68,11 +80,13 @@ If you added `SVProgressHUD` manually, just add a [bridging header](https://deve
|
||||
|
||||
(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]`).
|
||||
`SVProgressHUD` is created as a singleton (i.e. it doesn't need to be explicitly allocated and instantiated; you directly call `[SVProgressHUD method]` / `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):
|
||||
Using `SVProgressHUD` in your app will usually look as simple as this.
|
||||
|
||||
**Objective-C:**
|
||||
|
||||
```objective-c
|
||||
[SVProgressHUD show];
|
||||
@@ -84,6 +98,18 @@ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
});
|
||||
```
|
||||
|
||||
**Swift:**
|
||||
|
||||
```swift
|
||||
SVProgressHUD.show()
|
||||
DispatchQueue.global(qos: .default).async {
|
||||
// time-consuming task
|
||||
DispatchQueue.main.async {
|
||||
SVProgressHUD.dismiss()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Showing the HUD
|
||||
|
||||
You can show the status of indeterminate tasks using one of the following:
|
||||
@@ -115,9 +141,9 @@ If you'd like to stack HUDs, you can balance out every show call using:
|
||||
+ (void)popActivity;
|
||||
```
|
||||
|
||||
The HUD will get dismissed once the popActivity calls will match the number of show calls.
|
||||
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.
|
||||
Or show an image with status 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;
|
||||
@@ -128,53 +154,27 @@ Or show a confirmation glyph before before getting dismissed a little bit later.
|
||||
|
||||
## Customization
|
||||
|
||||
`SVProgressHUD` can be customized via the following methods:
|
||||
`SVProgressHUD` is designed with flexibility in mind, providing a myriad of customization options to fit the look and feel of your application seamlessly.
|
||||
|
||||
```objective-c
|
||||
+ (void)setDefaultStyle:(SVProgressHUDStyle)style; // default is SVProgressHUDStyleLight
|
||||
+ (void)setDefaultMaskType:(SVProgressHUDMaskType)maskType; // default is SVProgressHUDMaskTypeNone
|
||||
+ (void)setDefaultAnimationType:(SVProgressHUDAnimationType)type; // default is SVProgressHUDAnimationTypeFlat
|
||||
+ (void)setContainerView:(UIView*)containerView; // default is window level
|
||||
+ (void)setMinimumSize:(CGSize)minimumSize; // default is CGSizeZero, can be used to avoid resizing
|
||||
+ (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)setBorderColor:(nonnull UIColor*)color; // default is nil
|
||||
+ (void)setBorderWidth:(CGFloat)width; // default is 0
|
||||
+ (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)setImageViewSize:(CGSize)size; // default is 28x28 pt
|
||||
+ (void)setShouldTintImages:(BOOL)shouldTintImages; // default is YES
|
||||
+ (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)setGraceTimeInterval:(NSTimeInterval)interval; // default is 0 seconds
|
||||
+ (void)setMinimumDismissTimeInterval:(NSTimeInterval)interval; // default is 5.0 seconds
|
||||
+ (void)setMaximumDismissTimeInterval:(NSTimeInterval)interval; // default is CGFLOAT_MAX
|
||||
+ (void)setFadeInAnimationDuration:(NSTimeInterval)duration; // default is 0.15 seconds
|
||||
+ (void)setFadeOutAnimationDuration:(NSTimeInterval)duration; // default is 0.15 seconds
|
||||
+ (void)setMaxSupportedWindowLevel:(UIWindowLevel)windowLevel; // default is UIWindowLevelNormal
|
||||
+ (void)setHapticsEnabled:(BOOL)hapticsEnabled; // default is NO
|
||||
```
|
||||
* Appearance: Make use of the `UI_APPEARANCE_SELECTOR` to adjust styles, colors, fonts, size, and images app-wide.
|
||||
* Behavior: Control visibility durations, display delays, and animation speeds.
|
||||
* Feedback: Enhance the user experience with options for haptic feedback and motion effects.
|
||||
|
||||
Additionally `SVProgressHUD` supports the `UIAppearance` protocol for most of the above methods.
|
||||
For a comprehensive list of properties and detailed explanations, refer to the `SVProgressHUD.h` file in the API documentation.
|
||||
|
||||
### Hint
|
||||
|
||||
As standard `SVProgressHUD` offers two preconfigured styles:
|
||||
As standard `SVProgressHUD` offers three preconfigured styles:
|
||||
|
||||
* `SVProgressHUDStyleAutomatic`: Automatically switch between the light and dark style
|
||||
* `SVProgressHUDStyleLight`: White background with black spinner and text
|
||||
* `SVProgressHUDStyleDark`: Black background with white spinner and text
|
||||
|
||||
If you want to use custom colors use `setForegroundColor` and `setBackgroundColor:`. These implicitly set the HUD's style to `SVProgressHUDStyleCustom`.
|
||||
If you want to use custom colors use `setForegroundColor:` and/or `setBackgroundColor:`. These implicitly set the HUD's style to `SVProgressHUDStyleCustom`.
|
||||
|
||||
## Haptic Feedback
|
||||
|
||||
For users with newer devices (starting with the iPhone 7), `SVProgressHUD` can automatically trigger haptic feedback depending on which HUD is being displayed. The feedback maps as follows:
|
||||
Available on iPhone 7 and newer, `SVProgressHUD` can automatically trigger haptic feedback depending on which HUD is being displayed. The feedback maps as follows:
|
||||
|
||||
* `showSuccessWithStatus:` <-> `UINotificationFeedbackTypeSuccess`
|
||||
* `showInfoWithStatus:` <-> `UINotificationFeedbackTypeWarning`
|
||||
@@ -182,11 +182,10 @@ For users with newer devices (starting with the iPhone 7), `SVProgressHUD` can a
|
||||
|
||||
To enable this functionality, use `setHapticsEnabled:`.
|
||||
|
||||
Users with devices prior to iPhone 7 will have no change in functionality.
|
||||
|
||||
## 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
|
||||
@@ -194,11 +193,11 @@ Users with devices prior to iPhone 7 will have no change in functionality.
|
||||
|
||||
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.
|
||||
`SVProgressHUD` also posts `SVProgressHUDDidReceiveTouchEventNotification` when users touch on the overall screen or `SVProgressHUDDidTouchDownInsideNotification` when a user touches on the HUD directly. For these 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 avoid using unavailable APIs. Additionally call `setViewForExtension:` from your extensions view controller with `self.view`.
|
||||
When using `SVProgressHUD` in an App Extension, `#define SV_APP_EXTENSIONS` to avoid using unavailable APIs. This will be done automatically when using the `AppExtension` CocoaPods subspec. Additionally, call `setViewForExtension:` from your extensions view controller with `self.view`.
|
||||
|
||||
## Contributing to this project
|
||||
|
||||
@@ -211,8 +210,12 @@ review the guidelines written by [Nicolas Gallagher](https://github.com/necolas)
|
||||
|
||||
## License
|
||||
|
||||
`SVProgressHUD` is distributed under the terms and conditions of the [MIT license](https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE.txt). The success, error and info icons are made by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com) and are licensed under [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).
|
||||
`SVProgressHUD` is distributed under the terms and conditions of the [MIT license](https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE). The success, error and info icons used on iOS 12 are made by [Freepik](http://www.freepik.com) from [Flaticon](https://www.flaticon.com) and are licensed under [Creative Commons BY 3.0](https://creativecommons.org/licenses/by/3.0/).
|
||||
|
||||
## Privacy
|
||||
|
||||
`SVProgressHUD` does not collect any data. A [privacy manifest file](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files) is [provided](SVProgressHUD/PrivacyInfo.xcprivacy).
|
||||
|
||||
## Credits
|
||||
|
||||
`SVProgressHUD` is brought to you by [Sam Vermette](http://samvermette.com), [Tobias Tiemerding](http://tiemerding.com) and [contributors to the project](https://github.com/SVProgressHUD/SVProgressHUD/contributors). If you're using `SVProgressHUD` in your project, attribution would be very appreciated.
|
||||
`SVProgressHUD` is brought to you by Sam Vermette, [Tobias Totzek](https://totzek.me) and [contributors to the project](https://github.com/SVProgressHUD/SVProgressHUD/contributors). If you're using `SVProgressHUD` in your project, attribution would be very appreciated.
|
||||
|
||||
Reference in New Issue
Block a user