一句代码搞定三种弹框(面向协议的编程)
第一步:代码的架构看图(定义一个OutgoingServer,)我们只需要调用这个,
第二步: 从OutgoingServer获得弹框
+ (id<ActionSheetAlertInterfaces>)actionSheetWithTitle:(NSString *)title
message:(NSString *)message
preferredStyle:(UIAlertControllerStyle)preferredStyle
第三步实现:实现弹框,定一个协议,
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void(^ActionSheetBlock)(void);
typedef void(^ActionSheetTextFieldBlock)(UITextField * _Nonnull textField);
NS_ASSUME_NONNULL_BEGIN
@protocol ActionSheetAlertInterfaces