Closed kevinvanderlugt closed 7 years ago
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?
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.
@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.
Thanks for the example!
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
I was wondering if you had any thoughts on how to best handle this? My thought is to subclass
AcknowListViewController
and overridefunc 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!