saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add array of strings

Skylerbob opened this issue · comments

Is there a way that I could add an array of strings for one key, and leave the other 2 as non-array strings? Thanks

Currently I have this (Interests is an array of strings):
let message = Message(interests: interests, title: inputedTitle, body: inputedBody) //Cannot convert value of type 'Array<Any>' to expected argument type 'String'

No because Disk requires you specify a type so it knows how to properly store it. In your case I recommend creating a struct if you have a complicated data model, but it looks like you want to mix and match array and string types for the sake of convenience, is that correct? I don't recommend doing that because it could get confusing for you not knowing what exactly you're saving/retrieving.