Skip to content

Commit

Permalink
Fix private message view crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
bear101 committed May 9, 2021
1 parent 73303ee commit fdcd0dd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Client/iTeamTalk/iTeamTalk/TextMessageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,11 @@ class TextMessageViewController :

tableView.reloadData()

if tableView.numberOfRows(inSection: 0) > 0 {
// let ip = NSIndexPath(forRow: tableView.numberOfRowsInSection(0)-1, inSection: 0)
// tableView.scrollToRowAtIndexPath(ip, atScrollPosition: .Top, animated: true)
// let frame = tableView.frame
// let content = tableView.contentSize
// tableView.setContentOffset(CGPointMake(0, rect.height - frame.height), animated: true)
// if content.height > frame.height {
let ip = IndexPath(row: tableView.numberOfRows(inSection: 0)-1, section: 0)
tableView.scrollToRow(at: ip, at: .bottom, animated: true)
// }
let n_messages = messages.values.count
if n_messages > 0 {
let lastsection = messages.keys.count - 1
let ip = IndexPath(row: tableView.numberOfRows(inSection: lastsection) - 1, section: lastsection)
tableView.scrollToRow(at: ip, at: .bottom, animated: true)
}
}

Expand Down

0 comments on commit fdcd0dd

Please sign in to comment.