Last active
August 29, 2015 14:02
-
-
Save ariok/4442721559013780b8bf to your computer and use it in GitHub Desktop.
[swift]Extensions to help code readability
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 ViewController: UIViewController { | |
@IBOutlet var searchBar:UISearchBar | |
@IBOutlet var tableView:UITableView | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} | |
extension ViewController: UITableViewDataSource, UITableViewDelegate { | |
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int{ | |
return 10 | |
} | |
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!{ | |
let cell:DBTableViewCell = tableView.dequeueReusableCellWithIdentifier("dataCell") as DBTableViewCell | |
cell.labelName.text = "Ciao Ciao!" | |
return cell | |
} | |
} | |
extension ViewController: UISearchBarDelegate{ | |
// Your search bar delegate implementation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment