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

Open components to inheritance outside SDCAlertView module #311

Open
lechuckcaptain opened this issue May 14, 2020 · 4 comments
Open

Open components to inheritance outside SDCAlertView module #311

lechuckcaptain opened this issue May 14, 2020 · 4 comments

Comments

@lechuckcaptain
Copy link

It could be really useful if some classes implemented into the library would be open to inheritance (e.g. AlertController, AlertAction, ...). At the moment is not possible to extend any of those classes (first one is declared final, the latter is not open).

@sberrevoets
Copy link
Owner

Could you explain why that would be useful? It's a non-reversible decision so I want to make sure it's done for the right reasons.

@lechuckcaptain
Copy link
Author

I see your point. Let me explain more in detail my idea: having the possibility to extend AlertController (same concept on smaller scale for AlertAction) in order to prepare some ready to use complex customized variants.

Yes, I know that at least for the setup it would be possible to just write some static utility function (not the cleanest solution) or some wrapper class, but wouldn't be nice to have some specialized Alert that handle all the business logic (e.g. included custom views, text fields, ..) inside it instead of keeping them in the UIViewController that presents the alert?

@sberrevoets
Copy link
Owner

I get what you mean. I'll see if it's possible to make the classes themselves open without allowing for the public UIViewController methods to be overridden. Then the risk of interfering with some inherent behavior of the library is pretty low while you can still do what you want.

@lechuckcaptain
Copy link
Author

Thanks, let me know if you need help or some more detailed use cases

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