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