This is a beauful hud view for iPhone & iPad

Last update: Jun 19, 2022

WSProgressHUD

This is a beauful hud view for iPhone & iPad

CI Status Version License Platform Carthage compatible

Example

Usage

To Download the project. Run the WSProgressHUD.xcodeproj in the demo directory.

    [WSProgressHUD show];
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        ...

        dispatch_async(dispatch_get_main_queue(), ^{
        ...
        [WSProgressHUD dismiss];
        });
    });

//Show on the self.view

@implementation ViewController
{
    WSProgressHUD *hud;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    //Add HUD to view
    hud = [[WSProgressHUD alloc] initWithView:self.navigationController.view];
    [self.view addSubview:hud];

    //show
    [hud showWithString:@"Wating..." maskType:WSProgressHUDMaskTypeBlack];

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [hud dismiss];
    });

}

//Show on the window
    //show
    [WSProgressHUD show];

    //Show with mask
    [WSProgressHUD showWithMaskType:WSProgressHUDMaskTypeBlack];
    
    //Show with mask without tabbar
    [WSProgressHUD showWithStatus:@"Loading..." maskType:WSProgressHUDMaskTypeBlack maskWithout:WSProgressHUDMaskWithoutTabbar];
    
    //Show with string
    [WSProgressHUD showWithStatus:@"Loading..."];

    //Show with facebook shimmering
    [WSProgressHUD showShimmeringString:@"WSProgressHUD Loading..."];

    //Show with Progress
    [WSProgressHUD showProgress:progress status:@"Updating..."];

    //Show with image
    [WSProgressHUD showSuccessWithStatus:@"Thanks.."];
    
    //Show with string
    [WSProgressHUD showImage:nil status:@"WSProgressHUD"]

    //Dismiss
    [WSProgressHUD dismiss];
    
    //And There have 3 indicator style for your choice
    [WSProgressHUD setProgressHUDIndicatorStyle:WSProgressHUDIndicatorSmall] //small custom spinner

Installation

From CocoaPods

WSProgressHUD is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'WSProgressHUD'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate WSProgressHUD into your Xcode project using Carthage, specify it in your Cartfile:

github "devSC/WSProgressHUD"

Run carthage update to build the framework and drag the built WSProgressHUD.framework (in Carthage/Build/iOS folder) into your Xcode project (Linked Frameworks and Libraries in Targets).

Manually

Drag the WSProgressHUD/Demo/WSProgressHUD folder into your project. Then take care that WSProgressHUD.bundle is added to Targets->Build Phases->Copy Bundle Resources. Add the QuartzCore framework to your project.

Swift

Even though WSProgressHUD is written in Objective-C, it can be used in Swift with no hassle. If you use CocoaPods add the following line to your Podfile:

use_frameworks!

If you added WSProgressHUD manually, just add a bridging header file to your project with the WSProgressHUD header included.

Thanks

@Shimmering @SVProgressHUD @MMMaterialDesignSpinner

Author

Wilson-Yuan, [email protected]

License

WSProgressHUD is available under the MIT license. See the LICENSE file for more info.

GitHub

https://github.com/devSC/WSProgressHUD
Comments
  • 1. dismiss 方法执行后没有“立刻”消失,导致后面show出来的alert瞬间消失

    当前的场景是,开始网络请求,转菊花,响应之后结束菊花,同时开始进行数据验证,验证错误弹出text alert,3秒之后让其消失。

    可是现在的效果是,结束菊花后,菊花没有立刻消失,等到验证错误弹出后才消失,导致现在验证错误只显示了一瞬间。

    示例代码大概是这样,请问是我用法有误吗?

    [WSProgressHUD show];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [WSProgressHUD dismiss];
        [WSProgressHUD showImage:nil status:@"晕???"];
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [WSProgressHUD dismiss];
        });
    });
    
    Reviewed by siegrainwong at 2016-09-26 12:19
  • 2. 加在view上,dismiss后没有在view上移除导致内存泄漏

    比如如下写法:

    WSProgressHUD *hud = [[WSProgressHUD alloc]initWithView:view];
    [view addSubview:hud];
    [hud showImage:nil status:text maskType:WSProgressHUDMaskTypeDefault];
    
    显示后会自动调用dismiss方法。但是该方法中没有[self removeFromSuperview]。导致hud一直存在view上,占用内存
    不知道我的使用方法是否有误,如果有误,请指正
    
    Reviewed by heyehao2008 at 2016-09-29 09:28
  • 3. WSProgressHUDMaskTypeClear

    case WSProgressHUDMaskTypeClear: { CGContextRef context = UIGraphicsGetCurrentContext(); [[UIColor colorWithWhite:0 alpha:0.5] set]; CGRect bounds = self.bounds; CGContextFillRect(context, bounds); aplha 应该为0

    Reviewed by mf168 at 2015-09-15 03:46
  • 4. Add Shimmering as a Podspec dependency

    I think it's safer to have Shimmering as a dependency on your Podspec. Otherwise one can get duplicate symbol errors they are already using Shimmering in their project.

    Reviewed by kaandedeoglu at 2015-07-26 00:57
  • 5. Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    Reviewed by bryant1410 at 2017-04-18 01:31
  • 6. pod codes is different with your demo code?

    there are some methods for show images in cocopods

    #pragma mark - Show image
    
    + (void)showSuccessWithStatus: (NSString *)string
    {
        [self showImage:WSProgressHUDSuccessImage status:string];
    }
    
    + (void)showErrorWithStatus: (NSString *)string
    {
        [self showImage:WSProgressHUDErrorImage status:string];
    }
    
    
    + (void)showImage:(UIImage *)image status:(NSString *)title
    {
        [self showImage:image status:title maskType:WSProgressHUDMaskTypeDefault];
    }
    
    + (void)showImage:(UIImage *)image status:(NSString *)title maskType: (WSProgressHUDMaskType)maskType
    {
        [self showImage:image status:title maskType:maskType maskWithout:WSProgressHUDMaskWithoutDefault];
    }
    
    

    methods for show images in demo

    #pragma mark - Show image
    
    + (void)showSuccessWithStatus: (NSString *)string
    {
        [[self shareInstance] addOverlayViewToWindow];
        [self showImage:WSProgressHUDSuccessImage status:string];
    }
    
    + (void)showErrorWithStatus: (NSString *)string
    {
        [[self shareInstance] addOverlayViewToWindow];
        [self showImage:WSProgressHUDErrorImage status:string];
    }
    
    + (void)showImage:(UIImage *)image status:(NSString *)title
    {
        [[self shareInstance] addOverlayViewToWindow];
        [self showImage:image status:title maskType:WSProgressHUDMaskTypeDefault];
    }
    
    + (void)showImage:(UIImage *)image status:(NSString *)title maskType: (WSProgressHUDMaskType)maskType
    {
        [[self shareInstance] addOverlayViewToWindow];
        [self showImage:image status:title maskType:maskType maskWithout:WSProgressHUDMaskWithoutDefault];
    }
    
    

    addOverlayViewToWindow didn't called obviously. this issue will cause the bug which can't show WSProgressHUDSuccessImage or WSProgressHUDErrorImage when call [WSProgressHUD showErrorWithStatus:@"msg"]; or [WSProgressHUD showSuccessWithStatus:@"msg"]

    my environment: Xcode7.2.1, iOS9.2, pod version:1.1.0

    Reviewed by litt1e-p at 2016-03-15 07:05
  • 7. 您好,在 Podfile 加入 :generate_multiple_pod_projects => true 之后,编译不能通过

    我在 Podfile 中加入以下代码:

    install! 'cocoapods',
      :deterministic_uuids => false,
      :disable_input_output_paths => true,
      :generate_multiple_pod_projects => true
    

    在编译的时候报错:'FBShimmeringView.h' file not found 截图如下: image

    WSProgressHUD 版本为 1.1.5

    Reviewed by angelen10 at 2020-04-27 09:23
Simple Swift Progress HUD

MKProgress An iOS Simple Swift Progress HUD Requirements iOS 9.0+ Swift 3.0+ Xcode 8.0+ Installation MKProgress is only available via CocoaPods: pod '

Apr 6, 2022
A clean and lightweight progress HUD based on SVProgressHUD, converted to Swift with the help of Swiftify.

IHProgressHUD IHProgressHUD is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS. IHProgressHUD is based on

Jun 24, 2022
IOS HUD Swift Library

JHProgressHUD JHProgressHUD is an iOS class written in Swift to display a translucent HUD with an indicator and/or labels while work is being done in

Feb 27, 2021
A view class for iOS that makes uploading easy and beautiful.
A view class for iOS that makes uploading easy and beautiful.

SVUploader A view class for iOS that makes uploading easy and beautiful. Demo SVUploader is fully customizable - check out 2 demos. Installation Just

Apr 18, 2022
Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView.
Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView.

StepProgressView Step-by-step progress view with labels and shapes. A good replacement for UIActivityIndicatorView and UIProgressView. Usage let progr

Jun 11, 2022
Windless makes it easy to implement invisible layout loading view.
Windless makes it easy to implement invisible layout loading view.

Windless Windless makes it easy to implement invisible layout loading view. Contents Requirements Installation Usage Looks Credits Communication Licen

Jun 18, 2022
Show pleasant loading view for your users 😍
Show pleasant loading view for your users 😍

RHPlaceholder ?? Because traditional loading view like UIActivityIndicatorView or similar one are no longer so trendy (Facebook or Instagram apps are

Jun 5, 2022
ScanBarcodes is a SwiftUI view that scans barcodes using an iPhone or iPad camera.

ScanBarcodes ScanBarcodes is a SwiftUI view that scans barcodes using an iPhone or iPad camera. The framework uses AVFoundation for high performance v

Jun 20, 2022
Jun 18, 2022
BioViewer - Protein (.pdb, .cif and .fasta) viewer for iPhone, iPad and Mac, using SwiftUI + SceneKit
BioViewer - Protein (.pdb, .cif and .fasta) viewer for iPhone, iPad and Mac, using SwiftUI + SceneKit

BioViewer - Protein (.pdb, .cif and .fasta) viewer for iPhone, iPad and Mac, using SwiftUI + SceneKit

Jun 9, 2022
A "time ago", "time since", "relative date", or "fuzzy date" category for NSDate and iOS, Objective-C, Cocoa Touch, iPhone, iPad

Migration 2014.04.12 NSDate+TimeAgo has merged with DateTools. DateTools is the parent project and Matthew York is the project head. This project is n

Jun 19, 2022
iOS/iPhone/iPad Chart, Graph. Event handling and animation supported.
iOS/iPhone/iPad Chart, Graph. Event handling and animation supported.

#EChart A highly extendable, easy to use chart with event handling, animation supported. ##Test How To Use Download and run the EChartDemo project is

May 23, 2022
📱 Wire for iOS (iPhone and iPad)
📱 Wire for iOS (iPhone and iPad)

Wire™ This repository is part of the source code of Wire. You can find more information at wire.com or by contacting [email protected] You can find

Jun 19, 2022
A Swift mailing list client for iPhone and iPad
A Swift mailing list client for iPhone and iPad

Due to costs and lack of interest, I’ve had to take down the Charter service. If you’re interested in running your own copy, get in touch and I can se

May 10, 2022
TriangleDraw is a pixel editor for iPad and iPhone.
TriangleDraw is a pixel editor for iPad and iPhone.

TriangleDraw TriangleDraw is brilliant for sketching logos. You can quickly create designs that can be used for branding on letterheads or on your web

May 11, 2022
Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.

Introduction Little Go is a free and open source iOS application that lets you play the game of Go on the iPhone or iPad. You can play against another

Jun 6, 2022
A Modern MUD Client for iPhone and iPad.
A Modern MUD Client for iPhone and iPad.

MUDRammer — A Modern MUD Client > invoke incantation of build status divination You move a hand through a series of quick gestures, your digits twin

Feb 26, 2022
STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.
STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.

STPopup STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Obj

Jun 22, 2022
A quick and simple way to authenticate an Instagram user in your iPhone or iPad app.
A quick and simple way to authenticate an Instagram user in your iPhone or iPad app.

InstagramSimpleOAuth A quick and simple way to authenticate an Instagram user in your iPhone or iPad app. Adding InstagramSimpleOAuth to your project

Jul 15, 2021
A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app.
A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app.

DropboxSimpleOAuth A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app. Adding DropboxSimpleOAuth to your project CocoaPo

Dec 29, 2021