In PostController, in the createPostWith(image: caption: completion) method, it creates a Post instance, appends it to the posts array, then it calls the local addComment(toPost: commentText: completion) method, which contains a call to the cloudKitManager's save method which creates a comment in CloudKit. Then, returning to the createPostWith(image: caption: completion), we call the cloudKitManager.save method to save a post, but in the completion we are again calling the cloudKitManager's save method to save the comment again. Why is it being called twice on the same comment?
In PostController, in the createPostWith(image: caption: completion) method, it creates a Post instance, appends it to the posts array, then it calls the local addComment(toPost: commentText: completion) method, which contains a call to the cloudKitManager's save method which creates a comment in CloudKit. Then, returning to the createPostWith(image: caption: completion), we call the cloudKitManager.save method to save a post, but in the completion we are again calling the cloudKitManager's save method to save the comment again. Why is it being called twice on the same comment?