NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

Best practice for iCloud updates.

Forums > Swift

Hi All,

Hope you're all well.

I have a quick question, I am developing an app that allows users to add comments to items and the comments and items all are able to be uploaded to iCloud for backup and archival purposes and that works great.. a button a progress view and the function call takes care of it all, my question is...

I want to allow deletion of individual comments on the items and although I can get the deletion to happen on the UI side and programme the iCloud side I would like to know when would you advise I call the iCloud deletion function? Would it be immediately on deleing the comment UI side or when the app is closed/opened? I ask as with having the swipe to delete function enabled means it's going to be very easy to delete comments quickly and I have seen in Paul's Ultimate Portfolio app that repeated requests to iCloud will result in errors and a temporary time out so to speak.

Thanks for your help.

   

I would call it as soon as the comment gets deleted. You could implement an alert before deleting like (you really want to delete this) to add an artificial delay between possible deletions.

   

Hacking with Swift is sponsored by Play

SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!

Click to learn more about Play!

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.