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:@ " prompt content " withaction:@ " OK button or Cancel button " withoneclick: ^{
// Click OK button or Cancel button event, this code will automatically pop up after execution, very simple
}];
/// two option buttons, one OK, one cancellation, and of course the hint content
[[yz_alert YZ] twomessage:@ " prompt content " withaction:@ " OK " 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
GitHub
Https://github.com/YouZhiZheShiJingCheng/YZ_Alert
The best pop-up box for iOS