Commit f14ff2de authored by gm-mini's avatar gm-mini

mbp

parent 98cf49fa
......@@ -10,7 +10,7 @@ source 'git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git'
target 'GMShareSDK_Example' do
pod 'GMShareSDK', :path => '../'
pod 'MBProgressHUD', '1.1.0'
pod 'MBProgressHUD', '0.9.2'
target 'GMShareSDK_Tests' do
inherit! :search_paths
......
......@@ -54,7 +54,7 @@ PODS:
- WechatOpenSDK
- WeiboSDK
- Masonry (1.1.0)
- MBProgressHUD (1.1.0)
- MBProgressHUD (0.9.2)
- SDWebImage (5.4.0):
- SDWebImage/Core (= 5.4.0)
- SDWebImage/Core (5.4.0)
......@@ -64,7 +64,7 @@ PODS:
DEPENDENCIES:
- GMShareSDK (from `../`)
- MBProgressHUD (= 1.1.0)
- MBProgressHUD (= 0.9.2)
SPEC REPOS:
"git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git":
......@@ -97,12 +97,12 @@ SPEC CHECKSUMS:
GMPhobos: 1e2d68c456b69bf156276d7242877498107474db
GMShareSDK: 0eb73091491849a0f0bcf8c976ddef860fb44c0e
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
SDWebImage: 5bf6aec6481ae2a062bdc59f9d6c1d1e552090e0
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
WechatOpenSDK: 368ae03b72ee3ea1328c4f11326fbb5d2721d118
WeiboSDK: acb067053668102cf07d01aa7604350162c2e466
PODFILE CHECKSUM: f7f43230ff4b071c07a8cd96821fe597fdb590f6
PODFILE CHECKSUM: 7d810478599596071b1f4191c35ed3266ebed840
COCOAPODS: 1.8.4
Copyright © 2009-2016 Matej Bukovinski
Copyright (c) 2009-2015 Matej Bukovinski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
This diff is collapsed.
This diff is collapsed.
# MBProgressHUD
# MBProgressHUD [![Build Status](https://travis-ci.org/matej/MBProgressHUD.svg?branch=master)](https://travis-ci.org/matej/MBProgressHUD)
[![Build Status](https://travis-ci.org/matej/MBProgressHUD.svg?branch=master)](https://travis-ci.org/matej/MBProgressHUD) [![codecov.io](https://codecov.io/github/matej/MBProgressHUD/coverage.svg?branch=master)](https://codecov.io/github/matej/MBProgressHUD?branch=master)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) [![CocoaPods compatible](https://img.shields.io/cocoapods/v/MBProgressHUD.svg?style=flat)](https://cocoapods.org/pods/MBProgressHUD) [![License: MIT](https://img.shields.io/cocoapods/l/MBProgressHUD.svg?style=flat)](http://opensource.org/licenses/MIT)
MBProgressHUD is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features.
`MBProgressHUD` is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private `UIKit` `UIProgressHUD` with some additional features.
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/1-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/1.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/2-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/2.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/3-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/3.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/4-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/4.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/5-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/5.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/6-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/6.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/7-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/7.png)
**NOTE:** The class has recently undergone a major rewrite. The old version is available in the [legacy](https://github.com/jdg/MBProgressHUD/tree/legacy) branch, should you need it.
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/1-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/1.png)
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/2-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/2.png)
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/3-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/3.png)
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/4-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/4.png)
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/5-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/5.png)
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/6-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/6.png)
[![](http://dl.dropbox.com/u/378729/MBProgressHUD/7-thumb.png)](http://dl.dropbox.com/u/378729/MBProgressHUD/7.png)
## Requirements
`MBProgressHUD` works on iOS 6+ and requires ARC to build. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
MBProgressHUD works on any iOS version and is compatible with both ARC and non-ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
* Foundation.framework
* UIKit.framework
* CoreGraphics.framework
You will need the latest developer tools in order to build `MBProgressHUD`. Old Xcode versions might work, but compatibility will not be explicitly maintained.
You will need the latest developer tools in order to build MBProgressHUD. Old Xcode versions might work, but compatibility will not be explicitly maintained.
## Adding MBProgressHUD to your project
### CocoaPods
### Cocoapods
[CocoaPods](http://cocoapods.org) is the recommended way to add MBProgressHUD to your project.
1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 1.1.0'`
1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 0.9.2'`
2. Install the pod(s) by running `pod install`.
3. Include MBProgressHUD wherever you need it with `#import "MBProgressHUD.h"`.
### Carthage
1. Add MBProgressHUD to your Cartfile. e.g., `github "jdg/MBProgressHUD" ~> 1.1.0`
2. Run `carthage update`
3. Follow the rest of the [standard Carthage installation instructions](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add MBProgressHUD to your project.
### Source files
Alternatively you can directly add the `MBProgressHUD.h` and `MBProgressHUD.m` source files to your project.
......@@ -72,34 +61,20 @@ dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
});
```
You can add the HUD on any view or window. It is however a good idea to avoid adding the HUD to certain `UIKit` views with complex view hierarchies - like `UITableView` or `UICollectionView`. Those can mutate their subviews in unexpected ways and thereby break HUD display.
If you need to configure the HUD you can do this by using the MBProgressHUD reference that showHUDAddedTo:animated: returns.
```objective-c
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeAnnularDeterminate;
hud.label.text = @"Loading";
hud.labelText = @"Loading";
[self doSomethingInBackgroundWithProgressCallback:^(float progress) {
hud.progress = progress;
} completionCallback:^{
[hud hideAnimated:YES];
}];
```
You can also use a `NSProgress` object and MBProgressHUD will update itself when there is progress reported through that object.
```objective-c
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeAnnularDeterminate;
hud.label.text = @"Loading";
NSProgress *progress = [self doSomethingInBackgroundCompletion:^{
[hud hideAnimated:YES];
[hud hide:YES];
}];
hud.progressObject = progress;
```
Keep in mind that UI updates, inclining calls to MBProgressHUD should always be done on the main thread.
UI updates should always be done on the main thread. Some MBProgressHUD setters are however considered "thread safe" and can be called from background threads. Those also include `setMode:`, `setCustomView:`, `setLabelText:`, `setLabelFont:`, `setDetailsLabelText:`, `setDetailsLabelFont:` and `setProgress:`.
If you need to run your long-running task in the main thread, you should perform it with a slight delay, so UIKit will have enough time to update the UI (i.e., draw the HUD) before you block the main thread with your task.
......@@ -123,4 +98,4 @@ This code is distributed under the terms and conditions of the [MIT license](LIC
## Change-log
A brief summary of each MBProgressHUD release can be found in the [CHANGELOG](CHANGELOG.mdown).
A brief summary of each MBProgressHUD release can be found on the [wiki](https://github.com/matej/MBProgressHUD/wiki/Change-log).
......@@ -54,7 +54,7 @@ PODS:
- WechatOpenSDK
- WeiboSDK
- Masonry (1.1.0)
- MBProgressHUD (1.1.0)
- MBProgressHUD (0.9.2)
- SDWebImage (5.4.0):
- SDWebImage/Core (= 5.4.0)
- SDWebImage/Core (5.4.0)
......@@ -64,7 +64,7 @@ PODS:
DEPENDENCIES:
- GMShareSDK (from `../`)
- MBProgressHUD (= 1.1.0)
- MBProgressHUD (= 0.9.2)
SPEC REPOS:
"git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git":
......@@ -97,12 +97,12 @@ SPEC CHECKSUMS:
GMPhobos: 1e2d68c456b69bf156276d7242877498107474db
GMShareSDK: 0eb73091491849a0f0bcf8c976ddef860fb44c0e
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
SDWebImage: 5bf6aec6481ae2a062bdc59f9d6c1d1e552090e0
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
WechatOpenSDK: 368ae03b72ee3ea1328c4f11326fbb5d2721d118
WeiboSDK: acb067053668102cf07d01aa7604350162c2e466
PODFILE CHECKSUM: f7f43230ff4b071c07a8cd96821fe597fdb590f6
PODFILE CHECKSUM: 7d810478599596071b1f4191c35ed3266ebed840
COCOAPODS: 1.8.4
This diff is collapsed.
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>0.9.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "QuartzCore"
OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
......
......@@ -132,7 +132,7 @@ THE SOFTWARE.
## MBProgressHUD
Copyright © 2009-2016 Matej Bukovinski
Copyright (c) 2009-2015 Matej Bukovinski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -191,7 +191,7 @@ THE SOFTWARE.
</dict>
<dict>
<key>FooterText</key>
<string>Copyright © 2009-2016 Matej Bukovinski
<string>Copyright (c) 2009-2015 Matej Bukovinski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment