I have a “ProfileDetails” table connected to my user table which has a field called “relatedPhoto”.
How do I update this relatedPhoto field for the currentUser? I have an async function uploading an image to backendless and returning a URL, now I just need to set the “relatedPhoto” field in this related table with this new url value.
This is my code for a field that’s in the user table. Just wondering how it would work for a related table field:
uploadProfilePhoto(photo!, result: { (imageLink) in
let properties = ["photo" : imageLink!]
registeredUser.updateProperties(properties)
backendless.userService.update(registeredUser, response: { (updatedUser: BackendlessUser!) in
print("Uploaded photo")
}, error: { (fault: Fault!) in
print("error during photo upload: \(fault)")
})
})
Sorry, I have missed the language. The next time you create post on support please specify the language in topic.
I have assigned your topic to iOS/Swift developer.
This is my ProfileDetails class. It is a one to one relation from BackendlessUser:
class ProfileDetails: NSObject {
var title: String?
var company: String?
var jobTitle: String?
var websiteurl: String?
var profileDescription: String?
var relatedPhoto: String?
}