1. First of all, because the development needs to prompt a lot of information, can not display complete, demand requirements, display complete, automatic line wrapping and other functions; the developer needs to rewrite the three-party code as follows:
First step:
You must import the mbprogresshud three-party library in your project: Https://github.com/jdg/MBProgressHUD
Of course, you can also use Cocoapods to integrate third-party libraries, simply say the steps:
1.
The folder can be dragged to a DOS window using drag-and-drop files.
CD Project Path
2.
pod Search three-party library name (copy the required three-party library version)
3.
Vim Podfile write in Inside
Here 8.0 represents the minimum supported version of your app
Platform:ios ,'8.0'
Target: Project name do
pod ' Mbprogresshud ' , ' ~> 0.9.2 '
End
4.
sudo xcode-select--switch/applications/xcode.app
5.
Pod Install--verbose--no-repo-update
or : Pod install
Second Step: Import the header file of the three-party library
#import "MBProgressHUD.h"
The third step: the following code
/*
contains time, text , picture hint box
For multi-line text display
*/
-(void) Showmessagetitle: (nsstring *) title Anddelay: (int) timeint andimage: (nsstring *) imagestr{
mbprogresshud *hud = [mbprogresshud showhudaddedto: [uiapplication Sharedapplication]. Keywindow animated:YES];
Hud. userinteractionenabled = YES;
Hud. backgroundcolor = [uicolor clearcolor];
Hud. animationtype = mbprogresshudanimationzoomout;
Hud. Detailslabeltext = title;
Hud. Square = NO;
Hud. mode = mbprogresshudmodecustomview;
uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake( 0, 0, + )];
ImageView. image = [UIImage imagenamed: imagestr];
Hud. CustomView = imageView;
[Hud Hide:YES afterdelay: timeint];
}
/*
Contains time , text prompt box
Suitable for single-line text display
*/
-(void) Showmessagetitle: (nsstring *) title Anddelay: (int) timeint{
mbprogresshud *hud = [mbprogresshud showhudaddedto: [uiapplication Sharedapplication]. Keywindow animated:YES];
Hud. userinteractionenabled = YES;
Hud. backgroundcolor = [uicolor clearcolor];
Hud. animationtype = mbprogresshudanimationzoomout;
Hud. Detailslabeltext = title;
Hud. Square = NO;
Hud. mode = mbprogresshudmodetext;
[Hud Hide:YES afterdelay: timeint];
}
Operation Result:
Mbprogresshud Prompt for auto-wrapping in iOS development