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

How to fetch real password before revealing it? #24

Closed
everwanna opened this issue Feb 21, 2019 · 6 comments
Closed

How to fetch real password before revealing it? #24

everwanna opened this issue Feb 21, 2019 · 6 comments

Comments

@everwanna
Copy link

What's the best practice to do it?

I found that I have to write a subclass MyGenericPasswordCell of GenericPasswordCell and override the togglePasswordVisibility method. After that, I have to write a MyGenericPasswordRow, _GenericPasswordRow. The Eureka framework is not friendly to add new row type.

Actually, I just make visibilityButton public, and replace the target action.

@mats-claassen
Copy link
Member

Could you explain a bit more what you want to do?

@everwanna
Copy link
Author

My app cannot get user's password directly. It would fetch it remotely, decrypt it then show it when user touching the revealing button. Thanks!

@mats-claassen
Copy link
Member

Fetching the password remotely is not something this library does. You should do it independently and then set the value of the row to that password.

@everwanna
Copy link
Author

Well, I understand that. My problem is how can I hook the toggle action so I can fetch it remotely then reveal it to user.

@mats-claassen
Copy link
Member

Yeah in that case I think subclassing is the right way, to fetch the password and then revealing it, unless you are fine without changing togglePasswordVisibility.
You have a section about ]custom rows](https://github.com/xmartlabs/Eureka#custom-rows) in the Readme of Eureka and you can also follow the blog posts if you need help.

@everwanna
Copy link
Author

Thanks for your respond. I forked the source code and made visibilityButton public so I can replace its target action. It works well. 😄

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

No branches or pull requests

2 participants