Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request #43

Open
Esqarrouth opened this issue Aug 5, 2015 · 5 comments
Open

Feature Request #43

Esqarrouth opened this issue Aug 5, 2015 · 5 comments

Comments

@Esqarrouth
Copy link

How about making the button work like a UISwitch?
When I press it, it stays down until I press it again?

@herinkc
Copy link
Member

herinkc commented Aug 22, 2015

Hi there!

Thanks for the request. We'd like to keep it as a button, but we welcome any PR 😄

@Esqarrouth
Copy link
Author

By using the button.selected attribute,
You could easily make it work like a uiswitch.

A property would check if this feature is active:
button.shouldStayDown = YES

Then simply add an inside target for your button for UIControlEvents.TouchUpInside)

When user presses the button:

func pressed() {
  if button.shouldStayDown == YES {
     if button.selected == YES {
        //make the button go up
     } else if button.selected == NO {
       //make the button go down and stay down
     }
    button.selected = !button.selected
  }
}

I would add this but I haven't been writing objc for a year 😁

@herinkc
Copy link
Member

herinkc commented Aug 22, 2015

We’ll try it out once we have time 👍

@horaciogarza
Copy link

It sounds good

@noob1211
Copy link

why would you want a button to stay down? just confuses the user, and makes your ui look broken...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants