UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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.

2      

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.

2      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.