Skip to content

Retrieve User Schema

An application can get a list of the properties associated with the user schema by using the following API:

- (void)describeUserClassWithResponseHandler:^(NSArray<UserProperty *> * _Nonnull)responseHandler errorHandler:^(Fault * _Nonnull)errorHandler;
func describeUserClass(responseHandler: (([UserProperty]) -> Void)!, errorHandler: ((Fault) -> Void)!)

Return Value

An array of UserProperty objects. The UserProperty class definition: UserProperty

Example

[Backendless.shared.userService describeUserClassWithResponseHandler:^(NSArray<UserProperty *> *userProperties) {
    for (UserProperty *userProperty in userProperties) {
        NSLog(@"Property name - %@", userProperty.name);
        NSLog(@"required - %i", userProperty.required);
        NSLog(@"identity - %i", userProperty.identity);
        NSLog(@"data type - %@", [userProperty getTypeName]);
    }
} errorHandler:^(Fault *fault) {
    NSLog(@"Error: %@", fault.message);
}];
Backendless.shared.userService.describeUserClass(responseHandler: { userProperties in
    for userProperty in userProperties {
        print("Property name - \(userProperty.name)")
        print("required - \(userProperty.required)")
        print("identity - \(userProperty.identity)")
        print("data type - \(userProperty.getTypeName())")
    }
}, errorHandler: { fault in
    print("Error: \(fault.message ?? "")")
})