Tuesday, November 29, 2022
HomeiOS Developmentios - The right way to evaluate an non-obligatory area to a...

ios – The right way to evaluate an non-obligatory area to a non-optional area in Realm queries?


I’m attempting to make use of the Realm question api in Swift to filter on the next Realm object:

public class Photograph: Object {

    @Endured(primaryKey: true) var photoID: UUID
    @Endured(listed: true) var remoteDateLastUpdated: Date?
    @Endured(listed: true) var localDateLastUpdated: Date
}

Discover that the one of many Date fields is non-obligatory and the opposite isn’t. I’m attempting to question this object like so:

    let photosToPush = self.photographs.the place({
        $0.remoteDateLastUpdated != $0.localDateLastUpdated
    })

However I get the error Can’t convert worth of kind Question<Date> to anticipated argument kind ‘Question<Date?>’

How can I typecast this to make this question work?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments