UITableView delegate.tableView(cellForRowAt) is returning -1

I’m working through the itunes U “Developing iOS 10 Apps with Swift” course from Stanford.  I was going through the demo in lecture 15 on “More Segues”.   Here’s a link to my code and here’s a link to the professor’s code.  From what I can see in interface builder we both have the same settings for the Expression Editor View Controller, but in this snippet of code in ExpressionEditorViewController.swift:

func heightForRow(at indexPath: IndexPath? = nil) -> CGFloat {
     if let indexPath = indexPath,
          let height = delegate?.tableView?(self, heightForRowAt: indexPath) {
            return height
        } else {
            return rowHeight
        }
    }
}

at like 4 both height and rowHeight are -1 for rows 0, 2, and 3. which are the name text field, eye controls, and mouth controls.  As such my popover height is too small for my content.  Again, same code in the instructors version works as expected.  Any help would be apprecated.

Powered by WPeMatico

You may also like...

Comments are closed.