import UIKit
class XuanListController: UITableViewController {
var menusArr:Array<(String,String?)> = [("saoyisao", "扫一扫"), ( "SignRule", "标记")]
override func viewDidLoad() {
super.viewDidLoad()
clearsSelectionOnViewWillAppear = false
preferredContentSize = CGSize(width: 320, height: 44)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return menusArr.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
let (languageNames, languageCode) = menusArr[indexPath.row]
cell.textLabel?.text = languageCode
cell.imageView?.image = UIImage(named: languageNames)
// Configure the cell...
return cell
}
}
相关分类