Skip to main content

All Questions

1 vote
1 answer
293 views

Deleting row of List crash, index is out of bounds

When using onDelete as I am below, I can remove all rows successfully but only if I work backwards from the last row. If I remove any other rows I get a crash with the below message. Is there a way to ...
Brandon's user avatar
  • 527
0 votes
1 answer
282 views

Delete row from Realm via SwiftUI occurs exception 'Object has been deleted or invalidated.'

I trying to delete row from SwiftUI list which load data from Realm DB, it's implemented like here: struct MyView: View { private let realm = try! Realm() var body: some View { ...
Grigorii's user avatar
3 votes
0 answers
262 views

SwiftUI Empty List Auto Refresh

I have a list of data from MongoDB Realm which is being displayed as a list on my View, however I want to show the Text("No list available") when the Realm has no data in it. I implemented ...
Amey Sunu's user avatar
0 votes
0 answers
238 views

Delete Realm Object in SwiftUI NavigationLink View

i'm having a list view, row view (for each element in the list) and detail view (which will be opened by a NavigationLink in the row view). In the detail view i have a delete button where i'm trying ...
Rakees's user avatar
  • 1
1 vote
0 answers
30 views

How to Display a Specific Type of Object in Realm Swift? [duplicate]

I'm new to Realm and I'm having some trouble displaying the result as plain text. When I query from Realm(and filtering if necessary), I get the result with all key-value pairs. The function I use to ...
Kelvin Jou's user avatar
0 votes
0 answers
229 views

SwiftUI List from Realm DB

How do I create a List from a Realm DB? I really struggle with the id thing. I have no clue how to implement it correctly. This is my ViewController: import SwiftUI import RealmSwift struct ...
Daniel's user avatar
  • 588
1 vote
2 answers
961 views

Error deleting records from a SwiftUI List and Realm

Has anyone been able to successfully integrate Realm with SwiftUI, especially deleting records/rows from a SwiftUI List? I have tried a few different methods but no matter what I do I get the same ...
fs_tigre's user avatar
  • 10.8k
1 vote
3 answers
4k views

How to delete data from SwiftUI List and Realm

The following code properly displays all of the 'Users' from Realm database in a SwiftUI List. My issue is deleting records when I swipe a row. When I swipe a row and tap the delete button, I ...
fs_tigre's user avatar
  • 10.8k
2 votes
1 answer
2k views

What is the right way to present data from Realm in SwiftUI List

I’m trying to fetch all of the items from Realm and display them in a SwiftUI List but I keep getting an error. In a UIKit/Realm application, I would just create a Results variable to store all of ...
fs_tigre's user avatar
  • 10.8k