Giter Site home page Giter Site logo

lixiang1994 / leealert Goto Github PK

View Code? Open in Web Editor NEW
1.3K 1.3K 201.0 10.14 MB

优雅的可自定义 Alert ActionSheet

License: MIT License

Objective-C 99.03% Ruby 0.12% Swift 0.85%
actionsheet alert alertview-alertviewcontroller alertviewcontroller custom customalertview demo ios iphone lee leealert objective-c pods

leealert's Introduction

Hi there 👋

  • 🇨🇳 I’m an iOS developer in Beijing
  • 💻 Focusing on Swift & iOS
  • 🔨 Creator of a few widely used applications and frameworks
  • :trollface: Github is amazing, I hope to create more useful things here

leealert's People

Contributors

kaelding avatar lixiang1994 avatar tory-xu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leealert's Issues

actionsheet 整体下移

请问如何实现整体向下移动offset y呢?

希望可以整体往下移动

具体请看看图片~
2019-02-22 9 47 50

一个issues & 一个建议

issues是。。。在 LeeAddTextField 的block回调内 如果加上 [tf becomeFirstResponder] 那么在肾5s上 键盘会把 action框的按钮遮挡住且无法取消到收键盘!

建议是。。。 如果手动点TextField 键盘起来 然后 alert的位置会自动往上移 避免被遮挡,但是感觉速度有点慢 建议能不能不要键盘完全出现后再 往上移,而是键盘willshow 通知的 的时候 就开始往上同步移动alert框?或者提供接口让开发者自己设置 往上移动的时机? 望作者大大采纳。谢谢

Swift

swift版的啥时候出来

循环引用

链式编程中的__weak 是不是没有必要?

可否实现二次封装

你好, 我觉得目前这种实现还算不上简单易用, 如果在一个页面上需要根据情况展示不同类型的alertview, 目前只能每个都重新实现一遍, 可否封装成那种可以动态添加item的实现呢?

如何获取textField的内容

如何获取textField的内容,我再弹出框显示一个textField,想获取内容。比如弹出个输入密码,输入之后确定,想在确定的时候获取到内容

不支持iPad

你好,我用了这个框架,但是没法适配ipad

可否增加不允许 scrollView 不允许滚动的操作?

`[LEEAlert alert]
.config
.LeeItemInsets(UIEdgeInsetsMake(0, 0, 0, 0))
.LeeHeaderInsets(UIEdgeInsetsMake(0, 0, 0, 0))
.LeeMaxWidth(320)
.LeeMaxHeight(540)
.LeeAddCustomView(^(LEECustomView *custom) {
custom.view = view;
custom.positionType = LEECustomViewPositionTypeCenter;

                            })
                            .LeeClickBackgroundClose(YES)
                            .LeeShow();`

调整了各种布局 总是 会导致custom view 的高度会加上 LEEAlert的scrollview高度 导致滚动空白效果

swift4 ios12 弹出失效

在swift4
ios12
xcode Version 10.0
的环境中, 代码执行无效(没有弹出框);

LEEAlert.alert().config.leeTitle("烯烃").leeContent("这是测试").leeShow;

allShareView里面报了很多错误

  • (void)safeAreaInsetsDidChange{

    [super safeAreaInsetsDidChange];

    self.shareScrollView.sd_layout
    .topSpaceToView(self.backGroundView , 20)
    .leftSpaceToView(self.backGroundView , VIEWSAFEAREAINSETS(self).left)
    .rightSpaceToView(self.backGroundView , VIEWSAFEAREAINSETS(self).left)
    .heightIs(100);

    if (isShowMore) {

      self.moreScrollView.sd_layout
      .topSpaceToView(self.lineView , 10)
      .leftSpaceToView(self.backGroundView , VIEWSAFEAREAINSETS(self).left)
      .rightSpaceToView(self.backGroundView , VIEWSAFEAREAINSETS(self).left)
      .heightIs(100);
    

    }
    }
    这个方法是哪里来的,怎么有super?这个view是继承自UIView

新需求

darling,这个加个多个视图同时弹出吗? 不加队列里 一个一个显示 一次显示多个那种 多谢多谢 我太翔了,代码我自己改不动。

好库

感谢作者的库 好用! 问题都是我自己没想周到

关于代码

不知道作者为什么把封装都写在一个文件,我全部看了一遍代码,封装的到位,就是因为都在一个文件 阅读起来非常不方便,应该用的是构建者模式设计的,不知道作者ios写多少年了

先把基础的东西配置好,然后再配置一些动态的东西,最后再调用LeeShow,为啥不行呢?

怕描述的不是很清楚,直接贴代码出来吧。就是封装了sheet是一个数组的方法。

  • (void)HDShowActionSheet:(NSString *)title detail:(NSString *)detail sheets:(NSArray *)sheets result:(VoidBlock_int)result{

    LEEAlertConfigModel *alertConfigModel = [LEEAlert actionsheet].config
    .LeeAddTitle(^(UILabel *label) {

      label.text = title;
      
      label.textColor = [UIColor whiteColor];
    

    })
    .LeeAddContent(^(UILabel *label) {

      label.text = detail;
      
      label.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.75f];
    

    })
    .LeeAddAction(^(LEEAction *action) {

      action.type = LEEActionTypeCancel;
      
      action.title = @"取消";
      
      action.titleColor = HDColorTheme;;
      
      action.backgroundColor = [UIColor whiteColor];
      
      action.clickBlock = ^{
          
          // 取消点击事件Block
      };
    

    })
    .LeeHeaderColor(HDColorTheme);

    [sheets enumerateObjectsUsingBlock:^(NSString *obj, NSUInteger idx, BOOL * _Nonnull stop) {
    alertConfigModel
    .LeeAddAction(^(LEEAction *action) {

          action.type = LEEActionTypeDefault;
          
          action.title = obj;
          
          action.titleColor = HDColorTheme;
          
          action.backgroundColor = [UIColor whiteColor];
          
          action.clickBlock = ^{
              
              if (result) {
                  result(idx);
              }
              
          };
      });
    

    }];
    //
    alertConfigModel.LeeShow();

}

关于自定义view,希望添加使用XIB 和 storyboard的demo。

目前项目中使用的customView是从XIB中或者storyboard中实例化出来的,但是frame总是不对,不知是不是我使用的方法不对,还是怎么的。如果可以的话希望增加一个demo,弹出一个XIB中的View,如果需要我也可以提供自己写的demo,供你修改。

sheet

怎么动态的控制sheet的个数呢?

LEEAction 背后的白线如何隐藏

LEEAction背后有个白线 由于我设置LEEAction的背景为透明 所以上面出现了一条白线 由于这里无法上传图片 所以我没办法说明白 我看你写的Dome里面的显示一个新手红包的alert弹框里面的LEEAction背后也是有个白线 如果可以+我QQ 我发下分层的截图给你看 或者你看你的demo 我就想知道如何隐藏

8.0+的系统会崩溃

bugly抓的信息是
SEGV_ACCERR
-[UIView(LEEShadowViewHandle) lee_alert_dealloc],我是手动集成的,在10.0+的系统不会崩溃,9.0+没试过,当push到一个控制器再从那个控制器返回就崩溃了

关于LeeShow();之后textView失去响应者的问题。

页面中存在textView,在LEEAlert显示之后,textView会失去第一响应者,这个问题应该怎么解决,我在源码里面将LeeWindow的endEditing设置为NO也没解决这个问题。
第二,addContent中,为label设置富文本,结果富文本中的tapAction无法生效,估计也是这个第一响应者的原因,请大佬看到这条issuse尽快回复一下我,不胜感激。

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.