Skip to content

How to use this with Swift Realm ? Can't init DataSet #32

Description

@wojczitsu

I've got:

class Statistics: Object {
...
}

func dataForChart() -> Results<Statistics>? {
        var result: Results<Statistics>?
        do {
            let realm = try Realm()
            result = realm.objects(Statistics.self)
        } catch let error as NSError {
            print("Realm error - get all: \(error.localizedDescription)")
        }
        return result
}

let set = RealmLineDataSet(results: database.dataForChart(), xValueField: "date", yValueField: yField) // this won't compile 

Last line gives error: Cannot invoke initializer for type 'RealmLineDataSet' with an argument list of type '(results: Results?, xValueField: String, yValueField: String?)'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions