【发布时间】:2016-01-07 00:13:54
【问题描述】:
我想在表格视图单元格中打开一个带有呼叫按钮和取消按钮的警报视图。
var arrayOfUsernames: [PFObject] = [ ]
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrayOfUsers.count
}
func numberOfSectionsInTableView(tableView: UITableView) -> Int{
return 1
}
func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "Tutors"
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell: CustomTableViewCell = TutorTable.dequeueReusableCellWithIdentifier("Tutor") as! CustomTableViewCell
cell.CUsername.text = self.arrayOfUsers[indexPath.row]
cell.Classes.text = self.arrayOfClasses[indexPath.row]
return cell
}
这是自定义表格视图单元
import UIKit
class CustomTableViewCell: UITableViewCell {
@IBOutlet weak var CUsername: UILabel!
@IBOutlet weak var Distance: UILabel!
@IBOutlet weak var Classes: UILabel!
@IBOutlet weak var Rating: UIImageView!
@IBAction func bookNow(sender: AnyObject) {
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
【问题讨论】:
标签: uitableview swift2 ios9 cell uialertcontroller