Questions tagged [fetchrequest]
45 questions
0
votes
1 answer
Return SwiftUI @FetchedResults count from child view to parent when @FetchRequest predicate filter changes
The parent view sends the child view a predicate filter string for a FetchRequest and a Binding to return the FetchedResults count.
The filter string is an @State property of the parent view. A change to the filter string in the parent causes the…

jesseblake
- 100
- 1
- 10
0
votes
1 answer
SwiftUI Fetching JSON API Data from api.city.bik
I am having issues trying to get this data. I heard there is a trick. Can anyone create a simple call to view the data from this api? Would truly appreciate it. Been trying for a week. I cant for the life of me get this simple api call to…

Dane Wilkerson
- 3
- 1
0
votes
0 answers
How to fetch DuckDuckGo API
i made a single webpage to get DuckDuckGo Instant Answer API result,
https://adamorielly.github.io/Ducksearch/
But i'm getting 405 Method Not Allowed response when i just tried to make a fetch GET request, Cross-Origin Request Blocked: The Same…

Adam
- 11
- 3
0
votes
1 answer
Swift - How to Save changes to CoreData Attribute
I'm able to save objects in CoreData. My Entity attribute is of type string and saves whatever is typed into a textfield. I'm able to update the attribute using FetchedEntityRequest[index] of whatever index I specify but i'm having trouble saving…

b_swift20
- 11
- 3
0
votes
1 answer
Core data predicates - what’s the benefit?
I recently started learning Core Data and I totally see why having managed observable objects brings huge benefits.
The part that’s not clear to me is why predicates are deemed so powerful when they, in my perception, are just sqlishy snippets.
That…

ximarin
- 401
- 3
- 14
0
votes
0 answers
Fetch data from cursor.execute(sql) to python list with filtering the specific variable value in sql
There is a dataset that has 70 million row records in sql-oracle, i execute it in python with:
cursor.execute(sql_q)
It is ok to take whole 70 million rows data to python with cursor.execute. However, converting list or dataframe takes really long…

Neverse
- 11
- 3
0
votes
2 answers
View with FetchRequest doesn't update on change
This is my first post to this forum and really hope that somebody can help me here. I would highly appreciate any help!
I am writing my first app with Swift UI (never used UIKit before) which I want to publish later on.
This is also my first app…

nfehren
- 1
0
votes
1 answer
SwiftUI: Change ForEach source or fetch request using Picker (Segmented)
I'm new to SwiftUI and coding in general, so sorry if this has being covered before. I did search about it but I couldn't find it clear enough.
I'm trying to make an app for storing notes and tasks. (I'm not planning to put it on the store, I'm too…

sinojotas
- 1
- 1
0
votes
1 answer
Active Storage and Image Uploading Images from React
I'm having some trouble creating a post request from React when including a file. I've tried switching the strong params to not-strong params by excluding .require(:user). By doing this I was able to create a post request, but the image did not come…

rrosenb1
- 33
- 6
0
votes
0 answers
SwiftUI @FetchRequest after screen lock not fetching data and returning nil properties
I have usual SwiftUI view like this
struct MyView: View {
@FetchRequest var users: FetchedResults
init() {
self._users = FetchRequest(
entity: User.entity(),
sortDescriptors: [
],
predicate:…

Michał Ziobro
- 10,759
- 11
- 88
- 143
0
votes
3 answers
How to replace @FetchRequest by dynamic call
I have this code in my SwiftUI project in works well
struct ContentView: View {
@State private var selectedCountry: Country?
@State private var showSetting = false
@FetchRequest(entity: Country.entity(),
sortDescriptors:…

Dawy
- 770
- 6
- 23
0
votes
1 answer
FetchRequest not possible inside a Sheet?
I have a SwiftUI App which have a MainView and this is calling a sheet like
this:.sheet(isPresented: $showingSheetFilter) {
FilterView()
}
The FilterView looks like this:
import SwiftUI
struct FilterView: View {
@FetchRequest(
…

gurehbgui
- 14,236
- 32
- 106
- 178
0
votes
1 answer
Show Data from CoreData
I have a SwiftUI project using CoreData Database with a Product entity in it. It has 2 attributes, id, and barcode.
Then I create a fetch request that seems to work but will result in an empty [Products].
When the view appears on screen I get the…

Glenn Drescher
- 61
- 5
-1
votes
1 answer
@FetchRequest not dynamically updating view
I am using the below fuucntion to fetch Data and dispaly it. The problem is the view updates but does not sort according to id's (as I read online, @FetchRequest doesnt update view dynamically). It is only when I refresh my view, I see the sorting…

Uday Agarwal
- 7
- 1
- 3
-1
votes
1 answer
Sorting @FetchRequest (not dynamically) with SwiftUI
I tried the entire day to find the simplest solution to sort a @FetchRequest without any success!
I have tried this little modification:
@AppStorage("sortTitle") private var sortTitle = true
@Environment(\.managedObjectContext) private var…

Alexnnd
- 429
- 4
- 13