Mam custom cell class
i custom nib
, który zawiera projekt dla tej komórki. W moim storyboard
nie widzę sposobu, aby połączyć tableview
jako segue
(jak masz z komórkami prototypowymi) Mam tam, ponieważ moja komórka jest dodana przez tableView:cellForRowAtIndexPath
.UITableViewCell przejść do widoku szczegółów, gdy ładuję komórkę ze stalówki?
Czy istnieje sposób na połączenie tej sieci, aby móc nadal korzystać z storyboardu w celu połączenia komórki z kontrolerem widoku szczegółów?
Oto mój kod tableView:cellForRowAtIndexPath
:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("cell") as MyTableViewCell?
if (cell == nil) {
tableView.registerNib(UINib(nibName: "MyTableViewCell", bundle: NSBundle(identifier: "com.company.InterfaceComponents")), forCellReuseIdentifier: "cell")
cell = tableView.dequeueReusableCellWithIdentifier("cell") as MyTableViewCell?
}
return cell!
}
Jak można to zrobić z wielu komórek? – MazzaMan
Nie wiem, co masz na myśli z wieloma komórkami, ale możesz użyć 'indexPath' w' didSelectRowAtIndexPath', aby zobaczyć, z której komórki pochodzi. – Bjarte