Git Product home page Git Product logo

Comments (5)

jcarbaugh avatar jcarbaugh commented on August 18, 2024

How timely! I was just looking into the same thing.

from tsmessages.

KrauseFx avatar KrauseFx commented on August 18, 2024

Hello,
You are right. My first thought were to just customize and change the values of design.json. This isn't possible when using Cocoapods.
Assigning a custom file name before using this class like [TSMessage setDesignConfigurationFileName:@"otherFile.json"] would be a nice option I guess.
Would that be a good solution?

from tsmessages.

mbaranowski avatar mbaranowski commented on August 18, 2024

Thanks for the quick reply. I implemented a solution in a fork that works for my project. I made notificationDesign a class function that returns a NSMutableDictionary. This way you could modify the styles programmatically when necessary. Additionally I added a convenience class function addNotificationDesignFromFile which merges in the contents of another json file into the notificationDesign dictionary. This was I can re-use the default styles in design.json which is useful to get started.

I'll submit a pull request in a second where you can review the changes.

from tsmessages.

jcarbaugh avatar jcarbaugh commented on August 18, 2024

@mbaranowski that solution would mostly fit my needs as well. Glad you've got a pull request ready to go.

Any ideas on adding new types to TSMessageNotificationType? I might just need to stick with re-styled default types for now.

from tsmessages.

KrauseFx avatar KrauseFx commented on August 18, 2024

Thanks for your great contribution. I merged it just now. I haven't yet tried loading a custom design file, the default one works fine.

I used these files in my apps for a year already and it wasn't planned to release it in the beginning. That's why it may not be perfect to customize right now. One temporary solution would be to just copy the files into your project and change what you need.

I have to come up with a more general solution for adding more designs in the future.

from tsmessages.

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.