saoudrizwan / Disk

Easily persist structs, images, and data on iOS
MIT License
3.11k stars 172 forks source link

Getting an error " No exact matches in call to static method 'save' " when trying to save to disk #87

Closed Jsayer7 closed 4 years ago

Jsayer7 commented 4 years ago

I'm following a SwiftUI tutorial (https://peterfriese.dev/replicating-reminder-swiftui-firebase-part1/) which leverages Disk, however I'm getting the following error when I try to use the Disk.retrieve and Disk.save methods:

"No exact matches in call to static method 'retrieve'" "No exact matches in call to static method 'save'"

I'm using Xcode 11.5.

ilkone commented 4 years ago

I'm having the exact same issue. Any ideas?

aqm1152 commented 4 years ago

Doing the same exact tutorial and running into the same issue. No exact matches in call to static method 'save' or 'retrieve' or any of the static methods. Running Xcode 11.5 as well.

peterlamar commented 4 years ago

Credit to @SantiagoSalem on the other thread, Add Codable to the Task struct to resolve:

// File: Models/Task.swift
enum TaskPriority: Int, Codable {
    case high
    case medium
    case low
}

struct Task: Codable, Identifiable  {
    var id: String = UUID().uuidString
    var title: String
    var priority: TaskPriority
    var completed: Bool
}
Jsayer7 commented 4 years ago

Closing per @peterlamar's latest comment. Thank you!