小编Far*_*azi的帖子

如何在tableview单元格中传递字典?

import UIKit

class ViewController: UIViewController, UITableViewDataSource,UITableViewDelegate {

    @IBOutlet weak var label: UILabel!
    @IBOutlet weak var imageView: UIImageView!
    @IBOutlet weak var tableView1: UITableView!

    let element = ["Sports": #imageLiteral(resourceName: "ios"),"Grocery":#imageLiteral(resourceName: "ios"),"Cosmetics":#imageLiteral(resourceName: "ios")]

    override func viewDidLoad() {
        super.viewDidLoad()
        tableView1.delegate = self
        tableView1.dataSource = self
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { …
Run Code Online (Sandbox Code Playgroud)

dictionary uitableview swift

-1
推荐指数
1
解决办法
492
查看次数

标签 统计

dictionary ×1

swift ×1

uitableview ×1