I'm struggling with segueing from one View Controller to another using a custom Table View Cell. The issue that occurs is that sometimes segues aren't triggered just by tapping the cell, but I have to tap twice.
For better understanding I've put a video on youtube.
As you can see in the video each time I tap a cell, I print out "Selected". However, some times when I tap the cell, the log prints out "Selected" but the segue isn't triggered before I tap anywhere in the app again.
Here's the code I use in this video. The code isn't that interesting though, since most is done in the storyboard.
First View Controller
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 100.0
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 2
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! CustomCell
cell.firstLabel.text = "I'm a Custom Cell"
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
println("Selected")
}
Custom Table View Cell
class CustomCell: UITableViewCell {
@IBOutlet var firstLabel: UILabel!
}
I'm using Xcode 6.4 and I've tested the app on several iOS devices with the same result.
Any help would be very much appreciated.
Thank you,
HE.