Storing arrays of string persistently in SwiftUI using AppStorage

2k views Asked by At

I'm trying to store an array of string in user defaults using the AppStorage property wrapper like this:

@AppStorage("History") var history: [String] = ["End of history"]

however I get the error No exact matches in call to initializer

Is this a limitation of AppStorage because UserDefaults can store arrays if I'm not wrong? What is a workaround I can use?

0

There are 0 answers