Skip to content

Retrieving Geo Categories

This API retrieves a list of all the application's geo categories.


- (void)getCategoriesWithResponseHandler:^(NSArray<GeoCategory *> * _Nonnull)responseHandler errorHandler:^(Fault * _Nonnull)errorHandler;
func getCategories(responseHandler: (([GeoCategory]) -> Void)!, errorHandler: ((Fault) -> Void)!)

Return Value

An array of GeoCategory objects.

Example

[Backendless.shared.geo getCategoriesWithResponseHandler:^(NSArray *categories) {
    for (GeoCategory *category in categories) {
        NSLog(@"%@", category.name);
    }
} errorHandler:^(Fault *fault) {
    NSLog(@"Error: %@", fault.message);
}];
Backendless.shared.geo.getCategories(responseHandler: { categories in
    for category in categories {
        print(category.name ?? "")
    }
}, errorHandler: { fault in
    print("Error: \(fault.message ?? "")")
})