What is the proper way to implement selection and highlight animations on UITableViewCell?

I am trying to code a UITableViewCell with a custom animation for both selection and highlight states. I have overridden the setSelected:animated: and setHighlighted:animated: methods. However, these two methods are always called with animated:false. Therefore, I am unable to determine whether the methods are being invoked by the system (when the table view clears selections) or when the user taps. Now, for the highlight, I could probably just assume that it is always invoked by the user since I didn't find any other way to only highlight a cell programatically. For setSelected:animated:, I must know whether to animate or not. At first, I couldn't find what is calling setSelected:animated: in the first place when I tap on the cell because even after overriding every UITableViewDelegate method without calling super, setSelected:animated: was getting called from somewhere.

After searching for days, I disassembled the UIKitCore.framework using hopper disassembler and found out that setSelected:animated: is actually called by touchesEnded:event: method. There is actually an internal setSelected: method which calls setSelected:animated: with false by default. Moreover, since there is no documented api which lets you only highlight a cell (without selection) and internally, setHighlighted:animated: is always called with false, so what is the purpose of having an animated argument in this method's signature?

I have found not a whole lot of examples on this. Whatever I have found involves calling tableView.select:rowAtIndexPath:animated with animated:true manually in may be didSelectRow or willSelectRow. That feels hacky because it calls setSelected:animated: twice.

I am sure that I am not the first one to implement custom animations for highlight and selection for the UITableViewCell.

Update:

This is what I have implemented so far and it works even though it feels hacky.

override func setSelected(_ selected: Bool, animated: Bool) {
    guard isSelected != selected else {
        return
    }
    super.setSelected(selected, animated: animated)
    if animated {...}
}

// how can I call animated with true?
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
    guard isHighlighted != highlighted else {
        return
    }
    super.setHighlighted(highlighted, animated: animated)
    if animated {...}
}


// overriding the touch handlers doesn't feel right.
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    setHighlighted(true, animated: true)
    super.touchesBegan(touches, with: event)
}

override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
    setHighlighted(false, animated: true)
    setSelected(!isSelected, animated: true)
    super.touchesEnded(touches, with: event)
}

override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
    setHighlighted(false, animated: true)
    super.touchesCancelled(touches, with: event)
}