Im努力从Firebase存储中将图像检索到TableView
。感谢任何帮助。下面是我的代码:在Swift Table中从Firebase存储中恢复图像
tableviewcell代码:
class HomeFeedCell : UITableViewCell {
Var feeds = [HomeFeed]()
var dbRef :FIRDatabaseReference!
var storage : FIRStorage!
@IBOutlet weak var Name: UILabel!
@IBOutlet weak var Location: UILabel!
@IBOutlet weak var Type: UILabel!
@IBOutlet weak var FeedImage: UIImageView!
func configureCellWith(product : HomeFeed)
{
Name.text? = product.name
Location.text? = product.location
Type.text? = product.type
func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
// Configure the view for the selected state
}
}
我的实现代码如下:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell1", forIndexPath: indexPath) as! HomeFeedCell
let details = feeds[indexPath.row]
cell.configureCellWith(details)
return cell
}
我能够成功显示的名称,位置和类型的详细信息,但我只是停留在检索图像上。下面是我的结构文件:
struct HomeFeed {
let key:String!
let name:String!
let location:String!
let review:String!
let type:String!
let photoURL:String