Created
May 20, 2015 09:35
-
-
Save anefkens/39b426c9665b5289389f to your computer and use it in GitHub Desktop.
DemoTableViewDelegate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ClaimsOverViewViewController: UIViewController, UITableViewDataSource | |
{ | |
@IBOutlet var claimsTableView: UITableView! | |
let cellID = "Cell" | |
let claims: NSArray = ["Claim1", "Claim2", "Claim3"] | |
@IBOutlet var dataTV: UITableView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
dataTV.registerClass(UITableViewCell.classForCoder(), forCellReuseIdentifier: cellID) | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} | |
extension ClaimsOverViewViewController: UITableViewDataSource | |
{ | |
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int | |
{ | |
return self.claims.count | |
} | |
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell | |
{ | |
let cell = tableView.dequeueReusableCellWithIdentifier(cellID) as! UITableViewCell | |
cell.textLabel?.text = self.claims[indexPath.row] as? String | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment