Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func yourSegname(sender: UISegmentedControl)
- {
- switch segmentedControl.selectedSegmentIndex
- {
- case 0:
- yourtableView.tag = 1
- // call first webservice and reload the data
- case 1:
- yourtableView.tag = 2
- // call second webservice and reload the data
- case 2:
- yourtableView.tag = 3
- // call third webservice and reload the data
- default:
- break;
- }
- }
- func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return comments.count
- }
- func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- //post's section == 0
- var cell: UITableViewCell!
- if tableView.tag == 1 {
- // load the past data
- }
- else if tableView.tag == 2{
- // load present data
- }
- else {
- // load future data
- }
- return cell
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement