When you refactor a project, you find that you need to pop up a hint, such as a successful login, a failed data request, a camera or photo album to upload your avatar, and more.
Today, I wrote a pop-up box, using the system's Uialertcontroller, but you have defined some of the ways to click the event, you can directly enter the content of the prompt and the options provided and the event when the option was clicked.
How to use:
Pilot header file: #import "YZ.h" or #import "yz_alert.h" are the same
And then:
Only one option button with prompt content
[[yz_ Alert yz] onemessage:@ " content " withaction :@ " " withoneclick< Span class= "S4" >:^{
// Click OK button or Cancel button event, this code will automatically pop up after execution, very simple
}];
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/855243/201703/855243-20170315174613620-1932653415. PNG "style=" border:0px; "/>
// two option buttons, one OK, one cancellation, and, of course, the content of the prompt
[[yz_ Alert yz] twomessage:@ " tip content " withaction :@ " withoneclick :^{
// Click OK to execute the code
} withtwo:@ " cancel " withtwoclick: ^{
// Click Cancel to execute the code
}];
// After the code executes, it will automatically eject very simple
three kinds and above are not the same for example, you can add up to 6 options
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/855243/201703/855243-20170315174737854-254591314. PNG "style=" border:0px; "/>
GitHub
Https://github.com/YouZhiZheShiJingCheng/YZ_Alert
This article is from the "Red Corner Antelope" blog, please be sure to keep this source http://2254359459.blog.51cto.com/10776102/1906984
The best pop-up box for iOS