Comments (11)
@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.
@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.
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.
Okay, cool. That sounds like a simple solution. Thanks! 👍🏼
from disk.
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.
@saoudrizwan - I have just quietly pushed the source code. It has a link back to Disk - https://github.com/AudioKit/ROMPlayer
from disk.
I read about Disk in your README, I'm honored! Thank you so much for the credit!
from disk.
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.
Oh sweet- Thanks for the support!
from disk.
@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.
@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)
- Support for reading files from the app bundle? HOT 1
- No performant way of checking if folder is empty HOT 2
- Warnings after importing disk HOT 2
- Custom Encoder not getting passed HOT 4
- BookLibrary macOS app using Disk now on the Mac App Store HOT 1
- How to delete saved file? HOT 1
- Nastromy iOS app using Disk is on the AppStore HOT 1
- Example of Disk working with simple relationships HOT 1
- Security HOT 2
- Add array of strings HOT 1
- Is there an encryption option? HOT 1
- How to save data using id ?
- The package dependency graph can not be resolved; unable find any available tag for the following requirements: https://github.com/saoudrizwan/Disk.git — 0.6.3 HOT 6
- Using alternates besides JSONDecoder for deserialization HOT 6
- Return URL when saving a file HOT 1
- Pass compression quality for jpeg images HOT 1
- Add helper method for copying file
- Getting an error " No exact matches in call to static method 'save' " when trying to save to disk HOT 4
- Running unit test on your local machine (macOS) clears ~/Documents/ folder
- What is the complexity of Disk.exists ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disk.