I’m new to Swift and am making my first Backendless database query using their api. I followed this tutorial.
Here’s the code:
func fetchingFirstPageAsync() {
let startTime = NSDate()
let query = BackendlessDataQuery()
backendless.persistenceService.of(Player.ofClass()).find(
query,
response: { ( players : BackendlessCollection!) -> () in
let currentPage = players.getCurrentPage()
let playersAvailable = currentPage as! [Player]
print(playersAvailable[0].club) // This is working
},
error: { ( fault : Fault!) -> () in
print("Server reported an error: \(fault)")
}
)
}