Tags » Tableview

SUPPORT LOCAL - TABLEVIEW - INTRODUCTION

The concept is simple, really:

  1. Let’s support local business & especially the tourism industry
  2. So that these businesses can bring capital into our community
  3. That they will use to…
  4. 541 more words
Community

Two TableView in One ViewController

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (tableView == table1)
    {
        return 5;
    }
    else if (tableView == table2)
    {
        return 5;
    }
    return 0;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView == table1)
    {
        return 30;
    }
    else if (tableView == table2)
    {
        return 40;
    }
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView == table1)
    {
        UITableViewCell *cell = ;
        
        cell.textLabel.text = ;
        
        return cell;
    }
    else if (tableView == table2)
    {
        
        UITableViewCell *cell = ;
        cell.textLabel.text = ;
        return cell;
        
    }
    return 0;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView == table1)
    {
        NSLog(@"First TableView Index: %@",);
    }
    else if (tableView == table2)
    {
        NSLog(@"Second TableView Index: %@",);
    }
} 46 more words
Objective C

Push With Segue (tableView)

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if () 
    {
        NSIndexPath *indexpath=;
        secondVc *ViewSecond=segue.destinationViewController;
        ViewSecond.strData=];
    }
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    ;
}
 23 more words
Objective C

Table View Part-3

import UIKit
class ViewController: UIViewController, UITableViewDataSource {
let dailyTask = [ "Check all windows", "check all doors", "check temperature of freezer","check the mailBox at at the end fo the lane","empty trash containers","if freezing, check water popes outside"]
 let weeklyTasks = ["check inside all unoccupied cabins", "run all faucets for 30 seconds","Walk the perimeter of property", "Arrange for dumpster pickup"]
 let twoWeekTasks = ["Run test on security alarm","check all motion detectors","Test smoke alarms"]
 func numberOfSections(in tableView: UITableView) -> Int {
 return 3 // declared 3 array formar
 }
 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
 switch section {
 case 0:
 return dailyTask.count
 case 1:
 return weeklyTasks.count
 case 2:
 return twoWeekTasks.count
 default:
 return 0
 }
 }
 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 let cell = UITableViewCell()
 var currentTask : String
 switch indexPath.section {
 case 0:
 currentTask = dailyTask
 case 1 :
 currentTask = weeklyTasks
 case 2:
 currentTask = twoWeekTasks
 default:
 currentTask = ""
 }
 cell.textLabel!.text = currentTask
 return cell
 }
 func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? 54 more words
TableView

Table View Part-2

// Created by MohammadAzmalHossain on 11/19/16.


import UIKit

class ViewController: UIViewController, UITableViewDataSource {
 let devCourse = [("ios app development with swift training","simon allardice"),("ios 8 SDK new features","Lee BrimeLow"),("Data visualization with D3.js","Ray Villaglobos"),("swift essential training","simon allardice"),("Up and Running with AngularJS","Dan Gookin"),("MySQL Essential Training","Scott Simpson"),("Building Adaptive andraid apps with franments","David Gassner")]
 func numberOfSections(in tableView: UITableView) -> Int {
 return 1
 }
 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
 return devCourse.count
 }
 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 let cell = UITableViewCell()
 let (courseTitle, courseAuthor) = devCourse
 cell.textLabel?.text = courseTitle
 return cell
 
 
 }
 
 
 override func viewDidLoad() {
 super.viewDidLoad()
 // Do any additional setup after loading the view, typically from a nib. 15 more words
TableView

Table View

// Created by MohammadAzmalHossain on 11/19/16.
import UIKit
class ViewController: UIViewController, UITableViewDataSource {
 func numberOfSections(in tableView: UITableView) -> Int {
 return 1
 }
 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
 return 5
 }
 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 let cell = UITableViewCell()
 cell.textLabel?.text = "Hello World"
 return cell
 }
 
 
 override func viewDidLoad() {
 super.viewDidLoad()
 // Do any additional setup after loading the view, typically from a nib. 13 more words
TableView

Custom TableView in Swift in iOS

Today we will learn how to make a simple custom tableview in ios using Xcode8 and swift 3

Steps 1:

  1. Create a new xcode project Lets say(CustomTableViewiniOSinSwift)
  2. 334 more words
Swift