Giter VIP home page Giter VIP logo

llswitch's People

Contributors

lilei644 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

llswitch's Issues

额。。。

好像有内存溢出。。。 用MLeakFinder 测试的时候,只是单纯addsubsview 到vc view里面 返回上一层就报了 循环引用了

-setOn:方法的问题

只有手动点击switch才会有动画. 如果直接用 -setOn: 方法来设置开关的开与关(非初始化的时候设置), 就会出现bug, 脸会越滚越远😂

LLSwitch在tableviewcell中使用会有问题

在每个tableviewcell中添加LLSwitch,默认都是on状态,然后数据源来记录每个cell的状态,手动改变一个LLSwitch状态,滚动几次就出问题了,不是关闭的时候出现笑脸,就是关闭的时候背景是on的背景。
麻烦楼主fix下,fix掉后我再接入使用。。。

自动布局不会显示

你好,自动布局不会显示

//滑动开关
    self.switchClose = [[LLSwitch alloc] init];
    self.switchClose.onColor = [UIColor colorWithHex:BG_SHOUYE alpha:0.86];    // switch is open color    开关打开的颜色
    self.switchClose.offColor = [UIColor colorWithHex:BG_SHOUYE alpha:0.66];    // switch is close color    开关关闭的颜色
    self.switchClose.faceColor = HEXCOLOR(COLOR_TONGYI_LV);    // switch face color    圆脸的颜色
    self.switchClose.animationDuration = 1.2f;    // switch open or close animation time    开关的动画时间
    [self.view addSubview:self.switchClose];
    [self.switchClose makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(INSET);
//        make.top.equalTo(self.).offset(INSET);
        make.bottom.equalTo(self.bottomView.top).offset(-INSET);
        make.width.equalTo(WIDTH_1*2);
        make.height.equalTo(HEIGHT_6);
    }];
 

Can you add a new delegate method that is called when the on/off state changes?

At the moment, I can only use the didTapOnLLSwitch method to detect a change in state. However, this is bad because:

If I have a LLSwitch that is originally on. And the user taps on it. The delegate method is called before the state changes. So if I get the on property of the switch in the delegate method, I will get on, not off. This means that I need to reverse the Bool value to get the new on/off state.

That's just weird. If I come back after a few months I won't know what the ! is doing there. This confuses people.

You see, the original UISwitch has a ValueChanged control event. Why not add such a delegate method to LLSwitch? It will look something like this:

func llSwitch(llSwitch: LLSwitch, didChangeValue value: Bool)

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.