Advertisement
Guest User

Untitled

a guest
Oct 16th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  4.  
  5. @IBOutlet weak var tableView: UITableView!
  6.  
  7. var items = ["Один", "Два", "Три", "Четыре", "Пять", "Шесть", "Семь", "Восемь", "Девять", "Десять"]
  8.  
  9. override func viewDidLoad() {
  10. super.viewDidLoad()
  11.  
  12. tableView.delegate = self
  13. tableView.dataSource = self
  14. }
  15.  
  16. func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  17. return items.count
  18. }
  19.  
  20. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
  21. var cell: MyTableViewCell = tableView.dequeueReusableCellWithIdentifier("Cell") as MyTableViewCell
  22. cell.cellLabel.text = items[indexPath.row]
  23. cell.cellImage.image = UIImage(named: "sample-886-ice-cream-cone@2x.png")
  24. return cell
  25. }
  26.  
  27.  
  28. override func didReceiveMemoryWarning() {
  29. super.didReceiveMemoryWarning()
  30. // Dispose of any resources that can be recreated.
  31. }
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement