I have a simple table view where I handle the select action on the table view. This action follows a segue.
If the segue is a push
segue, the next view
It seems (to me...) that this problem happens only when the cell selectionType
is not .none
.
You may change it to any other option (at the storyboard Attribute inspector
, set the Selection
field) and it will work fine (working for me...).
The cons is that it messing up the cell UI.
You can call the segue in DispatchQueue.main.async{}
block at the didSelect
delegate function of UITableViewDelegate
as people mention before.
I used the first solution and added at the cell itself -
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(false, animated: false)
}
This will make the cell 'highlight' at the tap, but it will return to its usual UI immediately and it fine for me...