💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
## 简要介绍 该库主要提供适用于项目中的几种弹出框/提示框,通过统一接口,方便项目维护。代码包含URAlert库文件以及AlertTest的Demo,可在 ~~~ http://192.168.0.116/monkey/iOS-URAlert.git ~~~ 下载示例代码,然后运行查看效果。 ## 导入方式 #### 使用Cocoapods导入 在Podfile文件中加入: ~~~ platform :ios, '7.0' target 'Test' do pod 'iOS-URAlert', :git => 'http://192.168.0.116/monkey/iOS-URAlert.git' end ~~~ 然后在终端执行命令: ~~~ $ pod install ~~~ 或者 ~~~ $ pod update ~~~ #### 手动导入 手动导入还需要手动添加第三方库: ~~~ ReactiveCocoa(2.5) ~~~ ## 使用说明 ### 样式设置 该类提供4中可供选择的样式: ~~~ typedef NS_ENUM(NSInteger, URAlertStyle) { URAlertStyleNone, //无样式、不显示 URAlertStyleAlert, //系统样式 URAlertStyleCustom, //自定义样式,类Android的长条提示 URAlertStyleHUB, //MBProgressHUD样式 }; ~~~ 同事提供3中提示状态,该状态只有在样式设置为URAlertStyleHUB时有效: ~~~ typedef NS_ENUM(NSInteger, URAlertType) { URAlertTypeInfo, URAlertTypeSuccess, URAlertTypeFailure }; ~~~ ### 使用方法 使用接口方法如下所示,可根据需要调用相关的方法即可。 ~~~ //设置URAlertStyleCustom样式的右边按钮背景色,只需设置一次即可 + (void)setThemeColor:(nullable UIColor *)color; + (void)alertWithStyle:(URAlertStyle)style message:(nullable NSString *)message; + (void)alertWithStyle:(URAlertStyle)style type:(URAlertType)type title:(nullable NSString *)title message:(nullable NSString *)message; + (void)alertWithStyle:(URAlertStyle)style type:(URAlertType)type title:(nullable NSString *)title message:(nullable NSString *)message viewController:(nullable UIViewController *)viewController; + (void)alertViewWithStyle:(URAlertStyle)style title:(nullable NSString *)title message:(nullable NSString *)message cancelButtonTitle:(nullable NSString *)cancelButtonTitle sureButtonTitles:(nullable NSString *)sureButtonTitles viewController:(nonnull UIViewController *)viewController handler:(_Nonnull buttonIndexBlock)buttonIndex; ~~~