/// <summary> /// Called when the DetailDisclosureButton is touched. /// Does nothing if DetailDisclosureButton isn't in the cell /// </summary> public override void AccessoryButtonTapped(UITableView tableView, NSIndexPath indexPath) { if (tableItems[indexPath.Row].Heading == "Overview") { UIAlertController okAlertController = UIAlertController.Create("Overview", "Cooking is not rocket science; humans have been cooking since we learned how to control fire; cooking does require attention to detail - here are four secrets to becoming a kitchen professional;", UIAlertControllerStyle.Alert); okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); owner.PresentViewController(okAlertController, true, null); tableView.DeselectRow(indexPath, true); } if (tableItems[indexPath.Row].Heading == "Read Carefully") { UIStoryboard board = UIStoryboard.FromName("Main", null); KSReadCarefullyViewController ctrl = (KSReadCarefullyViewController)board.InstantiateViewController("KSReadCarefullyViewController"); owner.NavigationController.PushViewController(ctrl, true); } if (tableItems[indexPath.Row].Heading == "Stay Focused") { UIStoryboard board = UIStoryboard.FromName("Main", null); KSStayFocusedViewController ctrl = (KSStayFocusedViewController)board.InstantiateViewController("KSStayFocusedViewController"); owner.NavigationController.PushViewController(ctrl, true); } if (tableItems[indexPath.Row].Heading == "Practice Safety") { UIStoryboard board = UIStoryboard.FromName("Main", null); KSPracticeSafetyViewController ctrl = (KSPracticeSafetyViewController)board.InstantiateViewController("KSPracticeSafetyViewController"); owner.NavigationController.PushViewController(ctrl, true); } if (tableItems[indexPath.Row].Heading == "Mistakes are OK") { UIStoryboard board = UIStoryboard.FromName("Main", null); KSMistakesOKViewController ctrl = (KSMistakesOKViewController)board.InstantiateViewController("KSMistakesOKViewController"); owner.NavigationController.PushViewController(ctrl, true); } }
public TableSourceKSMistakesOK(List <TableItem> items, KSMistakesOKViewController owner) { tableItems = items; this.owner = owner; }