func numberOfSectionsInTableView(tableView: UITableView) -> Int
{
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return 0
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = UITableViewCell(style:.Default, reuseIdentifier:"Cell")
//Color for selected cell
let selectedColor = UIView()
selectedColor.layer.backgroundColor = UIColor.whiteColor().CGColor
cell.selectedBackgroundView = selectedColor
cell.textLabel?.text = "hola"
return cell
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat
{
return CGFloat.min
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
{
tableView.deselectRowAtIndexPath(indexPath, animated: true)
let cell = tableView.cellForRowAtIndexPath(indexPath) as UITableViewCell!
}
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)
{
// Remove seperator inset
if cell.respondsToSelector(Selector("setSeparatorInset:"))
{
cell.separatorInset = UIEdgeInsetsZero
}
// Prevent the cell from inheriting the Table View's margin settings
if cell.respondsToSelector(Selector("setPreservesSuperviewLayoutMargins:"))
{
cell.preservesSuperviewLayoutMargins = false
}
// Explictly set your cell's layout margins
if cell.respondsToSelector(Selector("setLayoutMargins:"))
{
cell.layoutMargins = UIEdgeInsetsZero
}
}
func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView?
{
return UIView()
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.