lixiang1994 / LEEAlert

优雅的可自定义 Alert ActionSheet
MIT License
1.3k stars 204 forks source link

如何分开设置, 例如Action不固定, 或根据某条件设置不同属性如何写? #107

Open lixiang1994 opened 4 years ago

lixiang1994 commented 4 years ago
LEEAlertConfig * alert = [LEEAlert alert];
LEEAlertConfigModel * config = alert.config;
config.addXXXXX;
config.addXXXXX;
config.addXXXXX;
config.addXXXXX;
config.addXXXXX;

if (XXXX) {
     config.addXXXXX;
}
if (XXXX) {
     config.addXXXXX;
}
config.LeeShow();
bolee commented 4 years ago

这个没用,会被直接释放掉

lixiang1994 commented 4 years ago

@bolee 你把你写的代码发一下 我康康

bolee commented 4 years ago

@bolee 你把你写的代码发一下 我康康

另外一个issue回你了,是对的

yuwanglijun commented 3 years ago

所以最后是如何解决的呢?我是通过数组添加config.addXXXXX。

lixiang1994 commented 3 years ago

@yuwanglijun

LEEAlertConfig * alert = [LEEAlert alert];
LEEAlertConfigModel * config = alert.config;
config.addXXXXX;
config.addXXXXX;
config.addXXXXX;
config.addXXXXX;
config.addXXXXX;

if (XXXX) {
     config.addXXXXX;
}
for xxx in xxxx {
     config.addXXXXX;
}
config.LeeShow();
yuwanglijun commented 3 years ago

我后来是这样的,可以满足: LEEActionSheetConfig actionsheet = [LEEAlert actionsheet]; actionsheet.config .LeeAddAction(^(LEEAction action) {
}); for(...) { actionsheet.config .LeeAddAction } actionsheet.config .LeeShow();