我已将 Parse db 导入到 Backendless,并且我看到我的图像内容与字符串格式的数据相关,因此当我尝试获取它时仅显示为字符串(URL)。如何调用或将 url 转换为 UIImage 。谢谢
请参阅下面的脚本:
func fetching() {
let backendless = Backendless()
let query = BackendlessDataQuery()
backendless.persistenceService.of(Menu.ofClass()).find(query, response: { ( menu : BackendlessCollection!) -> () in
let currentPage = menu.getCurrentPage()
print("Loaded \(currentPage.count) Menu objects")
for menu in currentPage as! [Menu] {
print("Menu name = \(menu.name)")
self.name.text = menu.name
self.type.text = menu.type
print("Type = \(menu.type)")
print(menu.image)
}
},
error: { ( fault : Fault!) -> () in
print("Server reported an error: \(fault)")
})
}