# Adding or editing a child

I have a class which will add or edit a child. So whenever I click on "save," I need to check the child image. If it's an image, then I need to upload to the image server. Once that's done only, I need to save all other data to the data server. Here, I am looking for better names for methods save() and updateChild().

 func saveAction() {
switch validationResult {
case .Success:
save()
case .Failure(let errorType):
}
}

func save() {
if let image = child.image {
} else {
self.updateChild()
}
}

switch response {
case .success:
self.updateChild()
case .error:
self.updateChild()
}
})
}

func updateChild() {

• if ... { addNewChild() } editChild() or such. – Joop Eggen Aug 8 '16 at 9:59