IOS third-party framework-mbprogresshud

Source: Internet
Author: User

IOS third-party framework-mbprogresshud
Mbprogresshud Alert Box website address: Https://github.com/jdg/MBProgressHUD
The official website has provided enough examples for us to use, but in the implementation of development, we use only a small part of it. To make it easier to use, expand it below (Category)
Mbprogresshud+nj.h
#import "MBProgressHUD.h" @interface Mbprogresshud (NJ) + (void) showsuccess: (NSString *) success;+ (void) Showsuccess: ( NSString *) Success Toview: (UIView *) view;+ (void) ShowError: (NSString *) error;+ (void) ShowError: (NSString *) error Toview: (UIView *) view;+ (Mbprogresshud *) ShowMessage: (NSString *) message;+ (Mbprogresshud *) ShowMessage: (NSString *) Message Toview: (UIView *) view;+ (void) hidehud;+ (void) Hidehudforview: (UIView *) view; @end
Mbprogresshud+nj.m
#import "Mbprogresshud+nj.h" @implementation Mbprogresshud (NJ)/** * Display information * * @param text message content * @param icon * @para The view displayed by M view */+ (void) Show: (NSString *) Text icon: (NSString *) icon view: (UIView *) view{if (view = = nil) view = [[Uiapp    Lication Sharedapplication].windows Lastobject];    Quick display a hint message mbprogresshud *hud = [Mbprogresshud showhudaddedto:view animated:yes];    Hud.labeltext = text; Set Picture Hud.customview = [[Uiimageview alloc] initwithimage:[uiimage imagenamed:[nsstring stringwithformat:@ "MBProgres    shud.bundle/%@ ", Icon]];        Re-set Mode Hud.mode = Mbprogresshudmodecustomview;        Remove hud.removefromsuperviewonhide = YES from the parent control when hidden; Disappears after 1 seconds [HUD Hide:yes afterdelay:0.7];} /** * Display Success Information * * @param success Information content */+ (void) showsuccess: (NSString *) success{[self showsuccess:success toview:nil] ;} /** * Display Success Information * * @param success Information content * @param view display information views */+ (void) showsuccess: (NSString *) Success Toview: (UIView *) view{[self SHOW:SUCCESS icon:@ "Success.png" View:view];} /** * Display Error message * */+ (void) ShowError: (NSString *) error{[self showerror:error toview:nil];} /** * Display Error message * * @param error message Contents * @param view needs to display information */+ (void) ShowError: (NSString *) error Toview: (UIView *) VI ew{[self show:error icon:@ "error.png" View:view];} /** * Display Error message * * @param message message content * * @return return directly to a mbprogresshud, need to manually close */+ (Mbprogresshud *) ShowMessage: (nsstring *) message{return [self showmessage:message toview:nil];} /** * Display some information * * @param message message content * @param view needs to display information of the views * * @return directly return a mbprogresshud, need to manually close */+ (mbprogress HUD *) ShowMessage: (NSString *) message Toview: (UIView *) View {if (view = nil) view = [[UIApplication sharedapplication    ].windows Lastobject];    Quick display a hint message mbprogresshud *hud = [Mbprogresshud showhudaddedto:view animated:yes];    Hud.labeltext = message;    Remove hud.removefromsuperviewonhide = YES from the parent control when hidden;    Yes indicates a mask effect is required hud.dimbackground = yes; Return HUD;} /** * HandClose Mbprogresshud */+ (void) hidehud{[self hidehudforview:nil];} /** * Manual Off Mbprogresshud * * @param view display mbprogresshud views */+ (void) Hidehudforview: (UIView *) view{if (view = = Ni    L) view = [[UIApplication sharedapplication].windows Lastobject]; [Self Hidehudforview:view animated:yes];} @end

IOS third-party framework-mbprogresshud

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.