Disclosure indicator to specific cell in static TableView in Swift

前端 未结 4 359
暖寄归人
暖寄归人 2020-12-21 11:42

I created a static TableView and I would like to add or remove a disclosure indicator depending if we are consulting our own account or a guest account.

This is what

4条回答
  •  一整个雨季
    2020-12-21 12:01

    Just check if you want to show disclosure indicator in cellForRowAt indexPath method.

    if (wantsToShow){ // Your condition goes here
       cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
    }
    else{
       cell.accessoryType = .none
    }
    

    That's it.

提交回复
热议问题