Giter VIP home page Giter VIP logo

Comments (4)

vtourraine avatar vtourraine commented on July 29, 2024 1

@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.

from acknowlist.

vtourraine avatar vtourraine commented on July 29, 2024

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?

from acknowlist.

klwoon avatar klwoon commented on July 29, 2024

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.

from acknowlist.

klwoon avatar klwoon commented on July 29, 2024

Thanks for the example!

from acknowlist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.