Skip to content

Instantly share code, notes, and snippets.

@hsleedevelop
Last active December 5, 2018 05:36
Show Gist options
  • Select an option

  • Save hsleedevelop/7cfe852f617610f0d19621fccea1215f to your computer and use it in GitHub Desktop.

Select an option

Save hsleedevelop/7cfe852f617610f0d19621fccea1215f to your computer and use it in GitHub Desktop.
check retain count example
dataSource.dataReloaded
.filter { [dataSource, tableView] in dataSource?.sectionModels.first?.items.isEmpty == false && tableView?.isEditing == false}
.debug(">>>>>>>>>>> CFGetRetainCount >> \(CFGetRetainCount(self))")
.emit(onNext: { [weak self] _ in
guard let self = self, let items = self.dataSource.sectionModels.first?.items else { return }
if self.viewModel.currentPage.page == 1, items.count <= 50 {//라이크 이벤트 발생 시 최상위로 이동
self.needScrollToTop = false
self.tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: UITableViewScrollPosition.top, animated: false)
}
})
.disposed(by: self.disposeBag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment