ESP32C3点灯保姆级教程:从电路设计到FreeRTOS任务创建(附完整代码)
2026/6/13 6:59:19
【免费下载链接】LEEAlert优雅的可自定义 Alert ActionSheet项目地址: https://gitcode.com/gh_mirrors/le/LEEAlert
LEEAlert是一个专为iOS开发者设计的优雅弹窗组件库,提供了高度可定制的Alert和ActionSheet功能。通过简洁的链式调用API,开发者可以快速创建符合应用设计风格的弹窗界面,告别系统原生弹窗的单调与局限。
[LEEAlert alert].config .LeeTitle(@"温馨提示") .LeeContent(@"这是一个高度可定制的弹窗示例") .LeeAddAction(^(LEEAction *action) { action.title = @"确定"; action.clickBlock = ^{ NSLog(@"点击了确定按钮"); }; }) .LeeShow();手动集成
git clone https://gitcode.com/gh_mirrors/le/LEEAlert将LEEAlert文件夹中的源文件拖入你的Xcode工程即可。
CocoaPods安装在Podfile中添加:
pod 'LEEAlert'标准Alert弹窗
[LEEAlert alert].config .LeeTitle(@"操作确认") .LeeContent(@"您确定要删除这条记录吗?") .LeeAddAction(^(LEEAction *action) { action.title = @"取消"; action.type = LEEActionTypeCancel; }) .LeeAddAction(^(LEEAction *action) { action.title = @"删除"; action.type = LEEActionTypeDestructive; action.clickBlock = ^{ // 执行删除操作 }; }) .LeeShow();ActionSheet样式
[LEEAlert actionSheet].config .LeeTitle(@"选择操作") .LeeAddAction(^(LEEAction *action) { action.title = @"拍照"; }) .LeeAddAction(^(LEEAction *action) { action.title = @"从相册选择"; }) .LeeAddAction(^(LEEAction *action) { action.title = @"取消"; action.type = LEEActionTypeCancel; }) .LeeShow();红包领取弹窗
[LEEAlert alert].config .LeeCustomView(redPacketView) // 自定义红包视图 .LeeClickBackgroundClose(YES) .LeeShow(); // 在红包视图中处理领取逻辑 - (void)receiveRedPacket { [LEEAlert closeWithCompletionBlock:^{ // 红包领取成功后的处理 }]; }表单输入弹窗
[LEEAlert alert].config .LeeTitle(@"修改昵称") .LeeAddTextField(^(UITextField *textField) { textField.placeholder = @"请输入新昵称"; textField.text = currentNickname; }) .LeeAddAction(^(LEEAction *action) { action.title = @"取消"; }) .LeeAddAction(^(LEEAction *action) { action.title = @"保存"; action.clickBlock = ^{ NSString *newNickname = [LEEAlert textFields].firstObject.text; // 更新昵称逻辑 }; }) .LeeShow();弹窗队列管理
// 设置弹窗优先级 [LEEAlert alert].config .LeePriority(LEEAlertPriorityHigh) .LeeTitle(@"重要通知") .LeeContent(@"请及时处理") .LeeShow(); // 低优先级弹窗会在高优先级弹窗关闭后显示 [LEEAlert alert].config .LeePriority(LEEAlertPriorityLow) .LeeShow();内存优化配置
[LEEAlert alert].config .LeeMaxWidth(280) // 限制弹窗最大宽度 .LeeMaxHeight(400) // 限制弹窗最大高度 .LeeShow();全局样式设置
// 配置全局主题 [LEEAlert config].LeeConfigMaxWidth(^CGFloat(LEEScreenOrientationType type) { if (type == LEEScreenOrientationTypeVertical) { return 280; } else { return 320; } }];LEEAlert以其简洁的API设计和强大的自定义能力,为iOS开发者提供了一套完整的弹窗解决方案。无论是简单的提示框还是复杂的业务弹窗,都能通过LEEAlert轻松实现。
【免费下载链接】LEEAlert优雅的可自定义 Alert ActionSheet项目地址: https://gitcode.com/gh_mirrors/le/LEEAlert
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考