# MKAlert **Repository Path**: shuleiming/MKAlert ## Basic Information - **Project Name**: MKAlert - **Description**: 优雅的自定义弹窗 - **Primary Language**: Swift - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-05-16 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MKAlert #### 介绍 优雅的自定义弹窗 ![优雅的弹窗](https://images.gitee.com/uploads/images/2019/0516/151101_f90ce2a5_1466007.png "屏幕快照 2019-05-16 下午3.10.09.png") #### 安装方法 将Tools中的两个文件拖入项目中。 #### 使用方法 弹出对话框 ```Swift let controller = MKAlertViewController(title: "Simple Alert", desc: "3 kinds of actions") controller.addAction(action: MKAlertAction(title: "第一个按钮")) controller.addAction(action: MKAlertAction(title: "第二个按钮")) controller.addAction(action: MKAlertAction(title: "第三个按钮")) controller.delegate = self present(controller, animated: false, completion: nil) ``` 使用代理来获取点击的按钮 ```Swift extension ViewController: MKAlertViewControllerDelegate { func handleDismiss(atIndex: Int) { print("click at index: \(atIndex)") } } ```