UIAlertControllerBuilder
是一个用于 iOS 的 Objective-C 链式封装库,用于优雅地构建 UIAlertController
弹窗。支持 Alert / ActionSheet、颜色设置、文本输入、自定义按钮、iPad Popover 等。
- ✅ 链式设置标题/消息:
title(@"标题").message(@"内容")
- ✅ 添加按钮及点击回调:
addAction(@"确认", style, color, block)
- ✅ 设置文字颜色:
titleColor(...)
、messageColor(...)
- ✅ 设置富文本标题和内容:
attributedTitle(...)
、attributedMessage(...)
- ✅ 支持
UIAlertControllerStyleAlert
和ActionSheet
- ✅ 支持 Alert 输入框:
addTextField(...)
- ✅ 支持 iPad Popover:
popoverConfig(...)
- ✅ 支持 presentIn / presentInWithCompletion
UIAlertControllerBuilder 支持通过 CocoaPods 集成:
pod 'UIAlertControllerBuilder'