Skip to content

Initializer for conditional binding must have Optional type, not 'Int' on ->"CLASS: ChatViewController" #2

Description

@w3villa-deepankar

private func scrollToBottomOfTableView(){
if let lastRow: Int = self.tableView.numberOfRows(inSection: 0) - 1 { ======> error:"Initializer for conditional binding must have Optional type, not 'Int'"

let indexPath = IndexPath(row: lastRow, section: 0)
self.tableView.scrollToRow(at: indexPath, at: .top, animated: false)
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions