# CHSimpleUI **Repository Path**: Cyptt/chsimple-ui ## Basic Information - **Project Name**: CHSimpleUI - **Description**: UI 归类 以wift为主 - **Primary Language**: Swift - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-31 - **Last Updated**: 2026-01-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CHSimpleUI ## 介绍 UI 归类 以wift为主 ## 组件 ## Alert ### CHDefaultAlertView 使用 - 使用实例 ``` let inputAlert:CHDefaultAlertView = CHDefaultAlertView() let cancelAction = CHAlertAction.init(title: "取消", style: CHAlertAction.Style.cancel,isClose: true) { action in print(action.title!) } inputAlert.addAction(cancelAction) let cancelAction2 = CHAlertAction.init(title: "确定", style: CHAlertAction.Style.default,isClose: false) { action in } inputAlert.addAction(cancelAction2) inputAlert.addTextField { textF in textF.placeholder = "0002" } inputAlert.isShowTextLine = true //是否是下划线,写在之前addTextField inputAlert.addTextField { textF, label in textF.placeholder = "0001" label.text = "欲拿来了" } inputAlert.show(title: "标题", msg: "内容内容内容内容内容内容内容内容内容内容内容内容内内容容内容内容") ``` - 属性 ``` inputAlert.setTitleColor(color: UIColor.red) //标题字体颜色 inputAlert.setTitleFont(font: UIFont.systemFont(ofSize: 20)) //标题字体 inputAlert.setMessageColor(color: UIColor.gray) //内容字体颜色 inputAlert.setMessagePisition(position: NSTextAlignment.center) //字体位置 inputAlert.setMessageFont(font:UIFont.systemFont(ofSize: 16)) //字体 inputAlert.setContentCornerRadius(cor: 3) //整体图层圆角 inputAlert.btnCornerRadius = 3 //按钮圆角大小 inputAlert.butttonFont = UIFont.systemFont(ofSize: 17) //按钮字体 inputAlert.cancelTitleColor = UIColor.red //取消按钮字体颜色 inputAlert.cancelBorderColor = UIColor.red //取消按钮border字体颜色 inputAlert.cancelBorderW = 1 //取消按钮border宽度 inputAlert.sureBtnColor = UIColor.blue //确定按钮颜色 inputAlert.sureTitleColor = UIColor.yellow //确定按钮字体颜色 inputAlert.textFBorderColor = UIColor.red //输入框边框颜色 inputAlert.textFCornerRadius = 2 //输入框边框圆角 inputAlert.textFBorderW = 1 //输入框边框宽度 ```