UITableViewのセルが画面外へはみ出しているため、
自動的に最後尾にスクロールさせるべく、
viewDidLoad内で、
let section = self.contentTableView.numberOfSections - 1 let row = self.contentTableView.numberOfRows(inSection: section) - 1 let indexPath = IndexPath(row: row, section: section) contentTableView.scrollToRow(at: indexPath, at: .bottom, animated: true)
と、記述しました。
そしてシミュレーターを起動すると、
One of the two will be used. Which one is undefined.
というエラーが出てしまいます。
ViewWillAppear内で、同じコードを記載すると、問題なく実行できるのですが、
初回表示でスクロールをさせたいので、ViewDidLoad内でコードを記述したいと思っています。
このエラーの原因・解消方法をご教示頂けますと幸いです。
回答1件
あなたの回答
tips
プレビュー