Posts

Post marked as solved
2 Replies
347 Views
Hi All, I'm using Core Data to store my data. I've followed the guide in the video but unable to complete the final steps. /// The core data stack `Data`     var dataProvider: datasProvider = .shared          func handle(intent: CreateNoteIntent, completion: @escaping (CreateNoteIntentResponse) -> Void) {         let title = intent.title!         let isBookmark = intent.isBookmark!         let photo = UIImage()                  let newIntent = Task { await self.dataProvider.addData(time: Date(), title: title, isFavorite: isBookmark as! Bool, image: photo) }                  let response = CreateNoteIntentResponse(code: .success, userActivity: nil)         response.noteIntent = newIntent //Error: Cannot assign value of type 'Task<(), Never>' to type 'Type'         completion(response)     } I'm using SwiftUI and it is for iOS app. Does anyone have a solution for this or can explain to me what went wrong please. Spent few hours figuring this out. Any help will be appreciated. Thank you.
Posted
by kaviraja.
Last updated
.
Post marked as solved
2 Replies
719 Views
Hi All, I'm very new to iOS app development. I've managed to complete the Scrumdinger tutorial. However, I would like to know how can I use CoreData or CloudKit to persist the data. URL: https://developer.apple.com/tutorials/app-dev-training/persisting-data I'm having trouble to bind the data to EditView(). Is there any online guide or tutorial that can help me? Thank you!
Posted
by kaviraja.
Last updated
.
Post not yet marked as solved
0 Replies
545 Views
Hi All, I'm very new to iOS development and Swift UI is my first coding language. I'm trying to link the users search results in Spotlight with the detail view that is stored in Core Data. I can search for users data in spotlight but when I tap on it, it's only appearing in the main view of the app. Is there anyways that I can use .onContinueUserActivity at the launch of the app or is there any different code that I have to use? I've searched for many articles but I couldn't get a solution. It would be good if anyone can share some links or guide here. Thank you. .onContinueUserActivity(DetailView.productUserActivityType) { userActivity in             if let product = try? userActivity.typedPayload(Product.self) {                 selectedProduct = product.id.uuidString             }         } I get this code from Apple's State restoration app but I can't use this with Core Data.
Posted
by kaviraja.
Last updated
.