Philographer

1. Class의 UIViewController 옆에 ,UITableViewDataSource, UITableViewDelegate 추가
2.다음 함수들 삽입
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 1
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return leftMenu.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    let cell = self.tableView.dequeueReusableCellWithIdentifier("leftCell", forIndexPath: indexPath) as! LeftTableViewCell

    let row = indexPath.row
    cell.cellTitle.text = leftMenu[row]
    // Configure the cell...

    return cell
}

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    // cell selected code here

}
3. ViewDidLoad에 다음을 추가
tableView.delegate = self
tableView.dataSource = self
댓글 로드 중…

트랙백을 확인할 수 있습니다

URL을 배껴둬서 트랙백을 보낼 수 있습니다