Have a reloadData for a UITableView animate when changing

前端 未结 17 2944
感动是毒
感动是毒 2020-11-28 17:25

I have a UITableView that has two modes. When we switch between the modes I have a different number of sections and cells per section. Ideally, it would do some cool anima

17条回答
  •  被撕碎了的回忆
    2020-11-28 17:45

    To reload all sections, not just one with custom duration.

    User duration parameter of UIView.animate to set custom duration.

    UIView.animate(withDuration: 0.4, animations: { [weak self] in
        guard let `self` = self else { return }
        let indexSet = IndexSet(integersIn: 0..

提交回复
热议问题