12207480 / DOPDropDownMenu-Enhanced

DOPDropDownMenu 添加双列表 优化版 新增图片支持(double tableView, The optimization version ,new add image,detailText)
MIT License
1.74k stars 362 forks source link

代码优化建议 以及功能拓展 #36

Open AnnieAri opened 7 years ago

AnnieAri commented 7 years ago

阁下的代码动画结束逻辑的 complete 全都放在的代码的末尾执行, 我认为这样是不对的 例如:

[self animateIndicator:indicator Forward:forward complete:^{
        [self animateTitle:title show:forward complete:^{
            [self animateBackGroundView:background show:forward complete:^{
                [self animateTableView:tableView show:forward complete:^{
                }];
            }];
        }];
    }];

    complete();

应该改为

[self animateIndicator:indicator Forward:forward complete:^{
        [self animateTitle:title show:forward complete:^{
            [self animateBackGroundView:background show:forward complete:^{
                [self animateTableView:tableView show:forward complete:^{
                        complete();
                }];
            }];
        }];
    }];

这样保证调用该方法时的 complete 是在所有动画完成时才调用的

另外几个建议 手势操作 例如 展开和收起 增加代码直接调用接口

- (void)menuTappedWithIndex:(NSInteger)tapIndex;  //通过传入 index 展开列表  代码引用
 -(void)menuTapped:(UITapGestureRecognizer *)paramSender

- (void)shrinkMenu;  //收起  代码引用
- (void)backgroundTapped:(UITapGestureRecognizer *)paramSender

感谢阁下提供这么优秀的代码 谢谢

Insofan commented 7 years ago

我也有个建议 插件会造成莫名其妙下移的原因可能是scrollview部分需要添加代码 .scrollsToTop = false