Comparing NSIndexPath Swift
If I have a NSIndexPath constant declared for a UITableView, is it valid to compare using the == operator? This is my constant declaration: let DepartureDatePickerIndexPath = NSIndexPath(forRow: 2, inSection: 0) And then my function: override func tableView(tableView: UITableView!, heightForRowAtIndexPath indexPath: NSIndexPath!) -> CGFloat { var height: CGFloat = 45 if indexPath == DepartureDatePickerIndexPath{ height = departureDatePickerShowing ? 162 : 0 } else if indexPath == ArrivalDatePickerIndexPath { height = arrivalDatePickerShowing ? 162 : 0 } return height } This certainly works