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

Thoughts on handling special licenses #29

Closed
kevinvanderlugt opened this issue Jun 29, 2017 · 4 comments
Closed

Thoughts on handling special licenses #29

kevinvanderlugt opened this issue Jun 29, 2017 · 4 comments
Labels

Comments

@kevinvanderlugt
Copy link

Howdy,

Thanks for this super useful tool! I just started using it and it's super helpful. One issue (not with your project) but when using GooglePlacePicker pod and a few other Google pods they actually have this weird license

simulator screen shot jun 29 2017 2 21 44 pm

I was wondering if you had any thoughts on how to best handle this? My thought is to subclass AcknowListViewController and override func commonInit(acknowledgementsPlistPath: String?) { then look specifically for these special license requirements.

Would you be interested in having something that handles these special licenses by letting the AcknowParser take a list of overrides for ["pod name": some closure that returns a string]? Totally fine if you don't want to add that complexity.

Cheers!

@vtourraine
Copy link
Owner

Hello Kevin, and thanks for your feedback!

I agree that this kind of licenses is problematic, but it seems like there’s no good universal solution.

When I need to edit the licenses, I just update the acknowledgements property on AcknowListViewController before presenting it. No need to subclass. Would that be a reasonable solution, in the context of your project?

@klwoon
Copy link

klwoon commented Jul 10, 2017

Could you post some example here how to update the acknowledgements property? I tried to modify the text but it won't allowed: Cannot assign to property: 'text' is a 'let' constant.

Thanks.

@vtourraine
Copy link
Owner

@klwoon Sure. Here’s an example, I manually set the acknowledgements property with hard-coded values:

let viewController = AcknowListViewController()
viewController.acknowledgements = [Acknow(title: "Test 1", text: "ABC"), Acknow(title: "Test 2", text: "DEF")]
navigationController?.pushViewController(viewController, animated: true)

An individual Acknow instance is immutable, this is why you had the error when you tried to edit the text property directly. You need to edit the acknowledgements array instead. Note that you can also use the Swift filter method to keep some values for the original array.

@klwoon
Copy link

klwoon commented Jul 11, 2017

Thanks for the example!

Repository owner deleted a comment from klwoon Jul 12, 2017
Repository owner deleted a comment from klwoon Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants