BLACK FRIDAY SALE: Save 50% on all my Swift books and bundles! >>

Ultimate Portfolio App - Designing a great model

Forums > SwiftUI

in this code below i think there is an error: batchDeleteRequest1 in the text of video 2 called Designing a great model: I think we have to remove the 1

private func delete(_ fetchRequest: NSFetchRequest<NSFetchRequestResult>) {
    let batchDeleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest)
    batchDeleteRequest.resultType = .resultTypeObjectIDs

    if let delete = try? container.viewContext.execute(batchDeleteRequest1) as? NSBatchDeleteResult {
        let changes = [NSDeletedObjectsKey: delete.result as? [NSManagedObjectID] ?? []]
        NSManagedObjectContext.mergeChanges(fromRemoteContextSave: changes, into: [container.viewContext])
    }
} 

   

This post needs to be in the Hacking with Swift+ forum. That's the one dedicated to HWS+ subscribers and the UltimatePortfolio.

Are you looking at a cached page, as the issue you mention isn't there? It is possible that Paul, or someone else, spotted it and it has already been corrected, in which case refreshing your page should help.

   

Send the typo to Paul at paul@hackingwithswift.com with Typo and link to page he will correct it

   

Hacking with Swift is sponsored by Guardsquare

SPONSORED AppSweep by Guardsquare helps developers automate the mobile app security testing process with fast, free scans. By using AppSweep’s actionable recommendations, developers can improve the security posture of their apps in accordance with security standards like OWASP.

Learn more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.