MMProgressHUD
==============
An easy-to-use HUD interface with personality.
It would be a shame for Mutual Mobile's in-house HUD interface to not be shared with the world. Now available for everyone!
<p align="center" >
<img src="Demo/VisualDemos/MMP3.gif" />
</p>
MMProgressHUD is a part of Mutual Mobile's growing suite of open-source Objective-C projects:
- [MMRecord](https://github.com/mutualmobile/MMRecord)
- [MMDrawerController](https://github.com/mutualmobile/MMDrawerController)
##Installation
Use cocoapods for installation: `pod 'MMProgressHUD'`
###Manual Install
If you really insist on doing things the hard way, simply include all of the files in the `Source/` folder in the repository in your project. If you don't already have it in your project, you'll need to link against the QuartzCore and CoreGraphics frameworks.
##Usage
Use the shared instance of `MMProgressHUD` through either the `+sharedHUD` class method or through the other suite of class convenience methods available.
##Features
###Animations
The primary motivation for building MMProgressHUD was to be able to easily add fun animations as they were needed. MMProgressHUD has several presentation/dismiss animation styles depending on what you are looking for:
1. **Drop** - When presented, the HUD drops from above the screen and hangs as if it were pinned on it's top corners to the top corners of the screen with string. The initial angle and constants for the keyframe animation are random so no two presentations look exactly the same. On dismissal, HUD falls as if both strings had been cut.
2. **Expand** - Presentation begins with the HUD very small, scaling larger to the final size with a small bounce. Dismissal begins with a small bounce around the original size up to a very large size.
3. **Shrink** - Presentation begins with the HUD much larger than reality, scaling smaller to the final size with a small bounce. Dismissal shrinks from the HUD's original size down to a small point with an alpha fade and a small initial bounce.
4. **Balloon** - Presentation begins below the screen with the HUD floating up from the bottom as if it were a balloon being let go into the air and hanging at the end of its string. Dismissal acts as if the string holding the balloon were cut and the HUD floats off the top of the screen.
5. **Fade** - Your standard alpha fade in/out.
Use `+ (void)setPresentationStyle:(MMProgressHUDPresentationStyle)presentationStyle;` to modify the presentation animation.
###No Assets
MMProgressHUD uses CoreGraphics-drawn images for the default images. This makes it very easy to drop-in all the files to your project without having to specify bundles and other assets to copy. Just include the source and you're good to go.
###Full-Screen
MMProgressHUD is window-based, so it will display the overlay above the status bar. This means that MMProgressHUD does not muck with your view hierarchies and will stay self-contained in its own window. MMProgressHUD does not make itself the key window at any point during presentation.
###Autosizing
MMProgressHUD supports almost arbitrary text content. As a matter of design and clutter, you probably shouldn't put too much text into a HUD, but MMProgressHUD will intelligently lay itself out depending on your text content. Changing the text and image content while the HUD is displayed will initiate an animation between the two states. This animation is very fast, yet not instantaneous in order to provide context of the state change.
###Extremely Basic User Interaction
MMProgressHUD supports extremely basic user input in the form of a confirmation tap from the user to initiate a "cancellation" action. After the user taps the HUD, it will enter a "confirmation" state in which the HUD changes state to let the user know the next tap will initiate some action that you define (see "Completion Blocks" below). For example, use this to let the user cancel a long-running task. The "confirmation" state resets back to the normal HUD state after a given timeout if the user has not confirmed the action. MMProgressHUD looks for a `cancelBlock` when determining whether or not to enter into the "confirmation" state.
```` lang:objective-c
+ (void)showWithTitle:(NSString *)title
status:(NSString *)status
confirmationMessage:(NSString *)confirmation
cancelBlock:(void(^)(void))cancelBlock;
````
###Completion Blocks
Some HUD actions can have an associated block of work attached to them to be fired when the action occurs:
1. `dismissAnimationCompletion` - A block of work that is executed when the HUD dismissal animation is completed.
2. `cancelBlock` - A block of work that is executed when the user cancels a long-running action. When this block is non-nil, the HUD will respond to taps and enter a "confirmation" state on first tap. When a confirmation tap is performed by the user, the HUD is dismissed and this block is fired.
3. `progressCompletion` - A block of work that is executed when the HUD's progress property is fed a value >= 1.f.
###Determinate Progress
By default, MMProgressHUD displays an indeterminate spinner, but it also supports determinate tasks through the progress APIs. Feed MMProgressHUD a progress (`[0,1]`), and it will display a progress indicator visually displaying the task progress to the user. Currently, only the radial progress indicator is supported.
```` lang:objective-c
+ (void)showProgressWithStyle:(MMProgressHUDProgressStyle)progressStyle
title:(NSString *)title
status:(NSString *)status
confirmationMessage:(NSString *)confirmation
cancelBlock:(void (^)(void))cancelBlock;
````
Update the progress HUD with the update APIs:
```` lang:objective-c
+ (void)updateProgress:(CGFloat)progress withStatus:(NSString *)status title:(NSString *)title;
+ (void)updateProgress:(CGFloat)progress withStatus:(NSString *)status;
+ (void)updateProgress:(CGFloat)progress;
````
##Setup
When setting up your instance of MMProgressHUD, you'll need to configure the settings according to the style and behavior you're trying to achieve. You can find the available properties in `MMProgressHUD.h`. These settings will persist across calls of `show` and `dismiss`, so you only have to set them once per instance:
1. `overlayMode` - The type of overlay that displays behind the HUD and over your content.
2. `successImage` - The success image you would like to use for success dismissal. The default image is a white check mark.
3. `errorImage` - The error image you would like to use for error situations. The default image is a white 'X'.
4. `confirmationMessage` - A message to be displayed to the user when a cancelable HUD action is displayed.
6. `presentationStyle` - The behavior animation the HUD performs when presenting and dismissing itself.
7. `glowColor` - The glow color the HUD emits while in the cancellation confirmation state.
8. `progressStyle` - The style that the HUD inherits when the HUD is in determinate progress state.
##Anatomy
MMProgressHUD consists of a window, an overlay view, and the HUD view itself. Since MMProgressHUD is window-based, the overlay will display full-screen over the status bar. The only two pieces of information related to MMProgressHUD's visual anatomy are the text labels:
<!--````
-- MMProgressHUDWindow (UIWindow)
---- MMProgressHUDOverlayView (UIView)
---- MMHud (UIView)
------ titleLabel (UILabel)
------ contentContainer (UIView)
------ statusLabel (UILabel)
```` -->
<p align="center" >
<img src="Demo/Images/title-status.png" />
</p>
`titleLabel` - The is the label at the top of the HUD above the content area.
`statusLabel` - The message label that is displayed at the bottom of the HUD below the center content area. In the absence of title text, this label's font will be the bold variant.
You will never access these label properties directly, but it's useful to know which text will be displayed in which label wh
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
MMProgressHUD源码 (110个子文件)
libOCMock.a 444KB
Current 1B
.DS_Store 12KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
GHUnitIOS 3.08MB
GHUnitIOS 26B
.gitignore 206B
GHTestMacros.h 40KB
MMProgressHUD.h 22KB
MMHud.h 9KB
GHTest.h 7KB
GHMockNSURLConnection.h 6KB
GHTestRunner.h 6KB
GHTestGroup.h 5KB
GHTestViewModel.h 5KB
GHAsyncTestCase.h 5KB
GHViewTestCase.h 5KB
GHTestCase.h 5KB
GHTesting.h 4KB
MMProgressHUDPrivate.h 4KB
NSException+GHTestFailureExceptions.h 4KB
GHTestSuite.h 4KB
NSValue+GHValueFormatter.h 3KB
GHUnitIOSTestView.h 2KB
GHUnitIOSViewController.h 2KB
GHUnit.h 2KB
GHUnitIOSView.h 2KB
GHMockNSHTTPURLResponse.h 2KB
GHImageDiffView.h 2KB
GHUnitIOSTestViewController.h 2KB
GHTestOperation.h 2KB
GHUnitIOSTableViewDataSource.h 2KB
GHUIImageViewControl.h 2KB
GHUnitIOSAppDelegate.h 1KB
GHTest+JUnitXML.h 1KB
GHTestGroup+JUnitXML.h 1KB
OCMConstraint.h 1KB
GHUnitIPhoneAppDelegate.h 1KB
MMProgressHUD+Animations.h 1KB
MMRadialProgressView.h 1KB
OCMockObject.h 1KB
OCMockRecorder.h 933B
OCMArg.h 846B
MMProgressHUDOverlayView.h 803B
NSNotificationCenter+OCMAdditions.h 505B
MMVectorImage.h 504B
MMProgressHUDWindow.h 472B
CoverageFix.h 459B
OCMock.h 447B
MMAppDelegate.h 389B
MMAppDelegate.h 385B
MMViewController.h 277B
MMProgressHUDViewController.h 255B
MMViewController.h 236B
Headers 24B
LICENSE 1KB
MMHud.m 27KB
MMProgressHUD+Animations.m 23KB
MMProgressHUD.m 21KB
MMViewController.m 15KB
MMProgressHUD+Class.m 13KB
MMProgressHUDTests.m 13KB
MMHudTests.m 8KB
MMRadialProgressView.m 5KB
MMProgressHUDOverlayView.m 5KB
MMProgressHUDViewController.m 4KB
MMAppDelegate.m 3KB
MMVectorImage.m 2KB
MMAppDelegate.m 2KB
MMProgressHUDWindow.m 2KB
MMViewController.m 803B
CoverageFix.m 442B
main.m 357B
main.m 353B
main.m 331B
README.md 8KB
project.pbxproj 45KB
MMProgressHUDDemo-Prefix.pch 416B
MMProgressHUDDemo-Prefix.pch 337B
GHUnitTests-Prefix.pch 325B
LogicTests-Prefix.pch 189B
MMProgressHUDDemo-Info.plist 1KB
GHUnitTests-Info.plist 1KB
MMProgressHUDDemo-Info.plist 1KB
xcschememanagement.plist 870B
LogicTests-Info.plist 696B
Info.plist 551B
title-status.png 33KB
[email protected] 18KB
2.png 2KB
5.png 2KB
3.png 2KB
6.png 2KB
1.png 2KB
4.png 2KB
MMProgressHUD.podspec 662B
Resources 26B
共 110 条
- 1
- 2
资源评论
- xautonetime2015-10-28我来开开效果 希望能用啊
- 明明love2015-10-27很不错 可以用 ! 下载出来看效果 , https://github.com/mutualmobile/MMProgressHUD
Kotim
- 粉丝: 7
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- matlab基于线性准则的考虑风力发电不确定性的分布鲁棒优化机组组合
- 基于C语言+stm32f4的modbus tcp上下位机通信项目+上位机由LabVIEW编写+源码+开发文档+视频教程(高分项目
- 基于Python的Struts2漏洞扫描器设计源码
- HTML+CSS制作的个人博客网页.zip
- 基于htmlde 爱心代码,但HTML网页源码.zip
- 51单片机实现LED流水灯
- 基于Python的obEspoir分布式游戏框架设计源码
- 基于python的机械设计实用计算器,可计算电动机,传动装置,V带轮,齿轮,轴,轴承的几何或者力,运动学参数数值+源码+开发文档
- 基于HTML +JavaScript的元旦倒计时代码.docx
- 【Unity资源免费分享】孩子益智小游戏unity 5x系列Baby Doll House Cleaning
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功