Post

Replies

Boosts

Views

Activity

Reply to How to remove duplicate objects from CoreData in Swift?
Actually the above will wipe all of your records because it doesn't select the winning objectID out of the collection of multiple results. Any good database design begins with data normalization, unique keys etc ...: Take a look at the following code by apple on how to dedupe core data records: https://developer.apple.com/documentation/coredata/synchronizing_a_local_store_to_the_cloud see CoreDataStack class
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to Cloudkit - Coredata and multiples database
You need to associate the test & prod with its own container id. Add them via Xcode iCloud capabilities containers list. let testContainerID = NSPersistentCloudKitContainerOptions(containerIdentifier:"your_bundle_id.test") let prodContainerID = NSPersistentCloudKitContainerOptions(containerIdentifier:"your_bundle_id.prod") Assign each container ID to the respective data store
Topic: App & System Services SubTopic: iCloud Tags:
Jan ’22
Reply to Transfer data on return
Read here swift guide on closures. class VCText: UIViewController { ... var completionHandler: (([addCatogrey])->Void)? ... @IBAction func doneBtnClicke(_ sender: Any) { ... /// return a copy of the array no need to create the object already added to the array a second time as done in your code using the delegate protocol pattern completionHandler?(arrS1) } } In view controller A ... let vc = self.storyboard?.instantiateViewController(withIdentifier: "VCText") as! VCText vc.delgateText = self // get rid of this /// define body of completion handler here vc.completionHandler = { array in /// do something with the array in view controller A } ...
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to Simulator stuck on white screen? (Django + Xcode)
This is most likely failing because you're ignoring failures on a non ssl http endpoint: read here if let response = try? JSONDecoder().decode([Account].self, from: data) {    DispatchQueue.main.async {              self.accounts = response     } } else { // add logic to handle api errors here }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to How to have the square (logo only) Apple sign in button.
Button(action: {}) {                 ZStack {                     RoundedRectangle(cornerRadius: 16)                         .fill(.gray)                     Image(systemName: "applelogo")                         .resizable()                         .padding(2.0)                 }             }             .frame(width: 120.0, height: 120.0)
Topic: App & System Services SubTopic: General Tags:
Jan ’22
Reply to Socket - web server problems
Who wrote the webserver? What compiler tools did you use to write the webserver? Who is sending the packets to the clients? Is your handcrafted webserver following all of the RFC-based specs? Was the webserver written with Xcode, does it run on the mac or any Apple mobile products? In this scenario, your web server is sending data in response to a client, not the other way around other than a get URL request.
Topic: App & System Services SubTopic: General Tags:
Jan ’22
Reply to Separating CoreData functionality from the View (SwiftUI) but Still with observability
@DelawareMathGuy this is what I had to do to trigger the FRCDelegate but this goes against the FRC automatically doing it after the performFetch fetchedResultsController?                 .publisher(for: \.fetchedObjects)                 .receive(on: OperationQueue.main)                 .sink(receiveValue: { [weak self] data in                     guard let self = self,                             let data = data else { return }                     for (index, object) in data.enumerated() {                         let indexpath = IndexPath(item: index, section: 0)                         if let controller = self.fetchedResultsController as? NSFetchedResultsController<NSFetchRequestResult> {                             self.controller(controller, didChange: object,                                             at: nil,                                             for: .insert,                                             newIndexPath: indexpath)                         }                     }                 }).store(in: &cancellables)
Topic: App & System Services SubTopic: iCloud Tags:
Jan ’22
Reply to How to remove duplicate objects from CoreData in Swift?
Actually the above will wipe all of your records because it doesn't select the winning objectID out of the collection of multiple results. Any good database design begins with data normalization, unique keys etc ...: Take a look at the following code by apple on how to dedupe core data records: https://developer.apple.com/documentation/coredata/synchronizing_a_local_store_to_the_cloud see CoreDataStack class
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to BigSur fortran not compiling
Just make sure the command line tools version matches the Xcode version installed. Best to download Xcode 13.2.1 and the matching version of command-line tools.
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode compilation is unusually slow -- Monterey
Stop building the benchmark project and focus on creating something.
Replies
Boosts
Views
Activity
Jan ’22
Reply to Cloudkit - Coredata and multiples database
You need to associate the test & prod with its own container id. Add them via Xcode iCloud capabilities containers list. let testContainerID = NSPersistentCloudKitContainerOptions(containerIdentifier:"your_bundle_id.test") let prodContainerID = NSPersistentCloudKitContainerOptions(containerIdentifier:"your_bundle_id.prod") Assign each container ID to the respective data store
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Transfer data on return
Read here swift guide on closures. class VCText: UIViewController { ... var completionHandler: (([addCatogrey])->Void)? ... @IBAction func doneBtnClicke(_ sender: Any) { ... /// return a copy of the array no need to create the object already added to the array a second time as done in your code using the delegate protocol pattern completionHandler?(arrS1) } } In view controller A ... let vc = self.storyboard?.instantiateViewController(withIdentifier: "VCText") as! VCText vc.delgateText = self // get rid of this /// define body of completion handler here vc.completionHandler = { array in /// do something with the array in view controller A } ...
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Simulator stuck on white screen? (Django + Xcode)
This is most likely failing because you're ignoring failures on a non ssl http endpoint: read here if let response = try? JSONDecoder().decode([Account].self, from: data) {    DispatchQueue.main.async {              self.accounts = response     } } else { // add logic to handle api errors here }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Apple Sign In Button does not work properly
This only tells half or less of the story. What is the button nested in? More code is needed to see what is actually causing the problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to How to have the square (logo only) Apple sign in button.
Button(action: {}) {                 ZStack {                     RoundedRectangle(cornerRadius: 16)                         .fill(.gray)                     Image(systemName: "applelogo")                         .resizable()                         .padding(2.0)                 }             }             .frame(width: 120.0, height: 120.0)
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Socket - web server problems
Who wrote the webserver? What compiler tools did you use to write the webserver? Who is sending the packets to the clients? Is your handcrafted webserver following all of the RFC-based specs? Was the webserver written with Xcode, does it run on the mac or any Apple mobile products? In this scenario, your web server is sending data in response to a client, not the other way around other than a get URL request.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Started receiving RENEWAL notification type
Deprecated doesn't mean removed. Just means you're to prepare to stop using it before it is actually removed.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to I am having trouble running a Xamarin iOS Application in an iOS Simulator on my Mac
This is a Microsoft product, please ask the guys over at Microsoft.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Socket - web server problems
That is a question for the guys a Microsoft.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Separating CoreData functionality from the View (SwiftUI) but Still with observability
@DelawareMathGuy this is what I had to do to trigger the FRCDelegate but this goes against the FRC automatically doing it after the performFetch fetchedResultsController?                 .publisher(for: \.fetchedObjects)                 .receive(on: OperationQueue.main)                 .sink(receiveValue: { [weak self] data in                     guard let self = self,                             let data = data else { return }                     for (index, object) in data.enumerated() {                         let indexpath = IndexPath(item: index, section: 0)                         if let controller = self.fetchedResultsController as? NSFetchedResultsController<NSFetchRequestResult> {                             self.controller(controller, didChange: object,                                             at: nil,                                             for: .insert,                                             newIndexPath: indexpath)                         }                     }                 }).store(in: &cancellables)
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Distribution of a Custom Mac OS Control
You have the option of a custom framework or custom library based on pods, swift package manager, etc but placing a custom UI control into the Xcode IDE is not supported hence why there is no documentation.
Replies
Boosts
Views
Activity
Jan ’22
Reply to General NavigationView & List State during device rotation
After watching Demystifying SwiftUI it demystified this issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22