我看不到来自tableView上的firebase存储的任何图像,这是我的代码:
import UIKit
import Firebase
import FirebaseStorage
import FirebaseStorageUI
class TariflerTableViewController: UIViewController,UITableViewDataSource,UITableViewDelegate{
@IBOutlet weak var TariflerTableView: UITableView!
var count = 8
override func viewDidLoad() {
super.viewDidLoad()
}
private func numberOfSections (_ tableView: UITableView)-> Int{
return 1
}
func numberOfSectionsInTableView(in tableView : UITableView)-> Int{
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 8
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = self.TariflerTableView.dequeueReusableCell(withIdentifier:"Tariflercell",for : indexPath) as! TariflerTableViewCell
let storage = FIRStorage.storage().reference(forURL: "gs://aaaa-d3253.appspot.com")
let imagePath = "KAHVE(\(count)).jpg"
let url = storage.child(imagePath)
url.downloadURL ( completion : {(url, error) in
if error != nil {
return
}
URLSession.shared.dataTask(with: url!, completionHandler: { (data, response, error) in
if error != nil{
return
}
guard let imageData = UIImage(data : data!) else{
return
}
DispatchQueue.main.async {
cell.imageViewy.image = imageData
}}).resume()
}
)
count -= 1
return cell
}