Post

Replies

Boosts

Views

Activity

Binary operator '<' cannot be applied to two 'Date?' operands
Hey guys. I have the error: "Binary operator '<' cannot be applied to two 'Date?' operands" popping up after changing this: class TaskItem: Object, Identifiable { @Persisted(primaryKey: true) var id: ObjectId @Persisted var taskTitle: String @Persisted var taskNotes: String @Persisted var taskDate: Date = Date() @Persisted var isFinished: Bool @Persisted var taskTime: Date = Date() @Persisted var isNotificationsEnabled: Bool @Persisted var taskColor: String static func < (lhs: TaskItem, rhs: TaskItem) -> Bool { if lhs.taskDate == rhs.taskDate { return lhs.taskTitle < rhs.taskTitle } else { return lhs.taskDate < rhs.taskDate } } } to: class TaskItem: Object, Identifiable { @Persisted(primaryKey: true) var id: ObjectId @Persisted var taskTitle: String @Persisted var taskNotes: String @Persisted var taskDate: Date? = nil @Persisted var isFinished: Bool @Persisted var taskTime: Date? = nil @Persisted var isNotificationsEnabled: Bool @Persisted var taskColor: String static func < (lhs: TaskItem, rhs: TaskItem) -> Bool { if lhs.taskDate == rhs.taskDate { return lhs.taskTitle < rhs.taskTitle } else { return lhs.taskDate < rhs.taskDate } } } Please help as fast as possible, since there is almost no more time left for the swift student challenge.
5
0
2.2k
Apr ’23
URL from iOS ImagePicker
Hey guys. I am trying to get the url out of an image selected from an imagePicker in swiftui (target: iPhone). Any ideas on how to do this?
Replies
1
Boosts
0
Views
1k
Activity
May ’23
Binary operator '<' cannot be applied to two 'Date?' operands
Hey guys. I have the error: "Binary operator '<' cannot be applied to two 'Date?' operands" popping up after changing this: class TaskItem: Object, Identifiable { @Persisted(primaryKey: true) var id: ObjectId @Persisted var taskTitle: String @Persisted var taskNotes: String @Persisted var taskDate: Date = Date() @Persisted var isFinished: Bool @Persisted var taskTime: Date = Date() @Persisted var isNotificationsEnabled: Bool @Persisted var taskColor: String static func < (lhs: TaskItem, rhs: TaskItem) -> Bool { if lhs.taskDate == rhs.taskDate { return lhs.taskTitle < rhs.taskTitle } else { return lhs.taskDate < rhs.taskDate } } } to: class TaskItem: Object, Identifiable { @Persisted(primaryKey: true) var id: ObjectId @Persisted var taskTitle: String @Persisted var taskNotes: String @Persisted var taskDate: Date? = nil @Persisted var isFinished: Bool @Persisted var taskTime: Date? = nil @Persisted var isNotificationsEnabled: Bool @Persisted var taskColor: String static func < (lhs: TaskItem, rhs: TaskItem) -> Bool { if lhs.taskDate == rhs.taskDate { return lhs.taskTitle < rhs.taskTitle } else { return lhs.taskDate < rhs.taskDate } } } Please help as fast as possible, since there is almost no more time left for the swift student challenge.
Replies
5
Boosts
0
Views
2.2k
Activity
Apr ’23
How to take off background from NavigationLink items.
Hey guys, I was using a ForEach loop and everything was fine. But when I implement NavigationLink, the background of each item turned gray. Any ideas on how to remove the background? Please answer as fast as possible. Much appreciated, mrhn_huor
Replies
2
Boosts
0
Views
1.5k
Activity
Apr ’23
How can I change the background colour of a list in SwiftUI.
Hey guys. I'm working on an app for the Swift Student Challenge and I found a problem. Each time I try to change the color of a whole list, nothing happens. For example, I tried to use .background(Color.black), but the list stayed gray. Please help as fast as you can. Much appreciated, mrhn_huor
Replies
2
Boosts
0
Views
746
Activity
Apr ’23