GithubHelp home page GithubHelp logo

Comments (11)

analogcode avatar analogcode commented on May 10, 2024 2

@saoudrizwan Thank for your assistance, and the library. I explored it more this morning, and, it works like a charm. We are going to use it in the new open-source AudioKit Synth to handle presets! AudioKit Synth One

from disk.

analogcode avatar analogcode commented on May 10, 2024 2

@saoudrizwan - Thank you and awesome! I actually have a few Kyle Dixon / Stranger Things inspired patches I made in the FM Player. Nice reference!

from disk.

saoudrizwan avatar saoudrizwan commented on May 10, 2024 1

Hey @swiftcodex thank you so much and you're welcome!

Yes I've actually thought about this scenario a bit. At the end of the day, Disk just uses JSONEncoder and JSONDecoder to convert structs to and from JSON data, so beyond their capabilities, messing with the JSON data may result in unexpected behaviors. I think it goes a bit out of Disk's purpose to offer handling conversion of invalid typed JSON files to new struct types. Let's say we have a struct Message, you save a message to the documents directory as message.json and then you update the Message model. Now you should first retrieve this outdated message data as Data:

try Disk.retrieve("message.json", from: .documents, as: Data.self) // instead of Message.self

And use the JSONSerialization class to manually retrieve your old message's properties and create a new instance of the new Message struct and manipulate the old data however you need to.

This way makes sense, since it's a process that needs to be fine tuned to the developer's scenario. JSONEncoder and JSONDecoder should take care of most edge cases like you mentioned, and will get better with updates to Swift.

I hope I helped! Thanks again for the kind words :^)

from disk.

analogcode avatar analogcode commented on May 10, 2024 1

Okay, cool. That sounds like a simple solution. Thanks! 👍🏼

from disk.

saoudrizwan avatar saoudrizwan commented on May 10, 2024 1

I'm glad to hear that @swiftcodex! I added Synth One to 'Apps Using Disk' on the README: https://github.com/saoudrizwan/Disk#apps-using-disk

If you run into any problems, let me know! :^)

from disk.

analogcode avatar analogcode commented on May 10, 2024 1

@saoudrizwan - I have just quietly pushed the source code. It has a link back to Disk - https://github.com/AudioKit/ROMPlayer

from disk.

saoudrizwan avatar saoudrizwan commented on May 10, 2024 1

I read about Disk in your README, I'm honored! Thank you so much for the credit!

from disk.

analogcode avatar analogcode commented on May 10, 2024

It seems to work if one removes a property from a struct. How cool would it be if it could load a struct that has since had properties added? And, those properties could just default to the struct's default values...

from disk.

analogcode avatar analogcode commented on May 10, 2024

Oh sweet- Thanks for the support!

from disk.

analogcode avatar analogcode commented on May 10, 2024

@saoudrizwan Here's another app in the app store we made that uses Disk.
https://audiokitpro.com/fm-player-classic-dx-released/

It has been getting rave reviews. Maybe thanks to Disk ;) https://ask.audio/articles/free-dx7-instrument-the-best-sounding-fm-synth-for-ipad

from disk.

saoudrizwan avatar saoudrizwan commented on May 10, 2024

@swiftcodex Wow! Congratulations on your app's success so far man, great great work! And you have no idea how glad it makes me to see Disk being used in apps like these that people love using. I can really tell you put a lot of attention to detail and the interface looks gorgeous! I'm actually a big Kyle Dixon fan so I love 80s synths haha.
I just added this to the README too, happy coding!

from disk.

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.