Giter Club home page Giter Club logo

wwmz / wmzdialog Goto Github PK

View Code? Open in Web Editor NEW
1.0K 11.0 181.0 14.35 MB

功能最多样式最多的弹窗,支持普通/底部/日期/地区/日历/选择/编辑/分享/菜单/自定义弹窗等,支持多种动画,链式编程调用(Pop-up windows with the most functions and styles, support normal/bottom/date/region/calendar/select/edit/share/menu/custom pop-up windows, etc., support multiple animations, chain programming calls)

License: MIT License

Objective-C 99.59% Ruby 0.11% Swift 0.29%
dialog payment pickview select menu custom calander ios13present toast datepicker

wmzdialog's Issues

BUG了,最小时间设置成当前时间,1月7号,变成了1月13号

NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
[dateComponents setYear:+20];
[dateComponents setMonth:-4];
NSDate *maxDate = [gregorian dateByAddingComponents:dateComponents toDate:[NSDate date] options:0];

NSDate *minDate = [NSDate date];

Dialog()
.wEventOKFinishSet(^(id anyID, id otherData) {
NSLog(@"选中 %@ %@",anyID,otherData);
})
//年月日时分秒|年月日|年月| 的格式 设置时间限制才有效 其余没有具体时间的约束无效
.wDateTimeTypeSet(@"yyyy年MM月dd日")
// .wDateTimeTypeSet(@"yyyy-MM-dd HH:mm:ss")
//最小时间
.wMinDateSet(minDate)
//最大时间
.wMaxDateSet(maxDate)
//此时最好关闭循环防止出错
.wPickRepeatSet(NO)
.wTypeSet(DialogTypeDatePicker)
.wStart();

横屏支持有问题

demo 模拟器上我横屏运行 然后点分享按钮 如图所示。
Simulator Screen Shot - iPhone 12 Pro Max - 2021-06-04 at 16 13 37

大侠,请问如何解决?

地区选择问题

地区选择的province_data.xml 可以支持外部传入吗,公司的文件的code码可能跟里面的不一样

XMLPathName 的bundle问题

非常感谢大佬的更新,但是这个属性取的文件还是在你的bundle中,能不能直接开放个主bundle的全路径,或者我直接把文件传进去呢

wEventCloseSet调用多次

            Dialog().wTypeSet(DialogTypeWrite)
            .wEventOKFinishSet(^(id anyID, id otherData) {
                NSLog(@"finish %@",anyID);
            }).wEventCloseSet(^(id anyID, id otherData) {
                NSLog(@"close %@",anyID);
            }).wEventCancelFinishSet(^(id anyID, id otherData) {
                NSLog(@"cancel %@",anyID);
            })
            //默认内容
            .wWriteDefaultTextSet(@"默认内容")
            //提示文本
            .wPlaceholderSet(@"请输入内容")
            //编辑框最大行数 大于行数则滚动
            .wWirteTextMaxLineSet(1)
            //键盘类型
            .wWirteKeyBoardTypeSet(UIKeyboardTypeDefault)
            .wStart();
  1. 点击确定按钮
2021-04-13 13:41:12.470764+0800 WMZDialog[13151:268534] close 关闭
2021-04-13 13:41:12.472211+0800 WMZDialog[13151:268534] finish 默认内容
2021-04-13 13:41:12.472638+0800 WMZDialog[13151:268534] close 关闭
  1. 点击取消按钮
2021-04-13 13:42:06.452467+0800 WMZDialog[13151:268534] close 关闭
2021-04-13 13:42:06.453379+0800 WMZDialog[13151:268534] cancel 取消
2021-04-13 13:42:06.453591+0800 WMZDialog[13151:268534] close 关闭
  1. 点击蒙层
2021-04-13 13:42:40.986170+0800 WMZDialog[13151:268534] close 关闭
2021-04-13 13:42:40.987132+0800 WMZDialog[13151:268534] close 关闭

日期选择器 设置最大日期后,最大日期后面的还是可以选

当默认日期与最大日期一致时,最大日期后面的日期还是可以选。如当前是12.2日,默认日期是12.2日,但12.2日之后的日期还是可以选。切换月份 - 重新选择12月时才会刷新2号后的日期不可选。
.wDateTimeTypeSet(@"yyyy-MM-dd")
.wPickRepeatSet(NO)
.wMaxDateSet([NSDate date])
.wDefaultDateSet([NSDate date])
.wMinDateSet([[NSDate date] dateByAddingYears:-1])

任意弹出框位置发生错乱

点击微信右上角,弹出选择框,程序推至后台,再回到前台,弹出框的位置跑到了视图中间去了!

DialogTypeWrite 下 点击ok 回调两次wEventOKFinish

DialogTypeWrite 下 点击ok 回调两次wEventOKFinish 原因应该是 WMZDialog+Write 中 这一个方法错误的调用了 writeOKAction:nil
//点击Return键键盘退出

  • (void)textViewDidEndEditing:(UITextView *)textView {
    if (textView == self.writeView) {
    if (self.wWirteTextMaxLine == 1) {
    [self writeOKAction:nil];
    }
    }
    }

DialogTypeAuto

DialogTypeAuto模式下,wMessageColorSet()
.wMainBackColorSet()这个修改为什么无效?

代码:
Dialog().wTypeSet(DialogTypeAuto)
.wMessageSet(@"AAAAAA")
//自动消失时间 默认1.5
.wMessageColorSet(DialogColor(0xCD3301))
.wMainBackColorSet(DialogColor(0xFFFFFF))
.wDisappelSecondSet(2)
.wStart();

编辑框类型弹框BUG

1、设置为单行时(其实是当做TextField用),内容为空时,placeholder上下显示不全。
2、设置为多行时(行数是-1),内容为空时,placeholder上下显示不全,如果继续点击键盘的删除或者直接输入文本,整个空间的上半部分View直接向下一点点变没了,按一下键盘就下移一截。

崩溃问题!

新版本的DialogCell 更改了cell的获取方式 从xib 获取,但是通过cocoapods安装时候,加载不到而导致了崩溃
+(instancetype)getCell{
return (DialogCell *)[[[WMZDialogTool getMainBundle] loadNibNamed:@"DialogCell" owner:nil options:nil] lastObject];
}
+(instancetype)getTextCell{
return (DialogCell *)[[[WMZDialogTool getMainBundle] loadNibNamed:@"DialogTextCell" owner:nil options:nil] lastObject];
}
+(instancetype)getImageCenterCell{
return (DialogCell *)[[[WMZDialogTool getMainBundle] loadNibNamed:@"DialogCenterCell" owner:nil options:nil] lastObject];
}

弹框中的三角形,支持圆角

需求:弹框中的三角形,看起来很不友好

办法:我只能修改您的如下代码
//上边
[path moveToPoint:CGPointMake(minX+cornerRadius, minY)];
// //三角形
// if (direction == directionUp) {
// [path addLineToPoint:CGPointMake(offset-width/2, minY)];
// [path addLineToPoint:CGPointMake(offset, minY-height)];
// [path addLineToPoint:CGPointMake(offset+width/2, minY)];
// }
//圆角
if (direction == directionUp) {
[path addLineToPoint:CGPointMake(offset-width/2, minY)];
[path addArcWithCenter:CGPointMake(offset, minY - 4.7) radius:2 startAngle:-M_PI_4 * 3 endAngle:-M_PI_4 clockwise:YES];
[path addLineToPoint:CGPointMake(offset+width/2, minY)];
}

希望作者能够支撑

NormalType弹窗问题

OK或Cancel按钮文字较多时显示不下,建议采用系统弹窗的做法,文字少时左右布局,文字多时上下布局

多级菜单的ID获取不到值

WMZTree这个类里面定义的是大写的ID,在点击事件中的字典里面又是用@“id”去拿值,这个会取到空。无法获取到id的值。

如何设置不在日期范围内的日期的颜色

大佬,如何设置不在日期范围内的日期的颜色,如设置日期范围大于今天的,那么今天以前的日期不可选择,我想把这些不可选择的日期的颜色都设置为灰色(浅色),让使用户看起来就知道是不能选择的。

.wWriteDefaultTextSet(@"")会导致高度计算异常,导致placeholder被截断

Simulator Screen Shot - iPhone 12 - 2021-04-13 at 23 24 38

复线的代码

            let dialog:WMZDialog = Dialog()
            dialog.wTypeSet()(DialogTypeWrite)
                .wEventOKFinishSet()({(anyId:Any?,otherData:Any?)in
                print("点击确定",anyId as Any);
            })
                .wPlaceholderSet()("请输入名称")
                .wWirteKeyBoardTypeSet()(.numbersAndPunctuation)
                .wWirteTextMaxLineSet()(2)
                .wWriteDefaultTextSet()("")
            _ = dialog.wStart()

当前有2个问题

问题1: issue code似乎在WMZDialog+Write.m 31 line self.wWriteDefaultText?:@"占位",这里应该用self.wWriteDefaultText.length > 0来判断, 因为当前我的DefaultText是空字符串

问题2: 我想确认项目中的Block都是Nonnull的吗?
举个例子,我想设置DefaultText, 值作为变量有可能存在或者不存在。因此当issue1存在时,我还可以这样写.wWriteDefaultTextSet(value?:nil),顶多是一个Null Passed的warning。但是换到swift这就是编译失败,因为参数必须是String,不能是Optional类型。所以只能在外层写if else,这也破坏了链式结构,非常的别扭。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.