I set an images for button\'s states Normal,Highlighted and Selected, but when the button in selected state and I press/highlight it I didn\'t see my highlighted image but j
If you need the highlighted tint which the OS provides by default when you tap and hold on a custom button for the selected state as well, use this UIButton subclass. Written in Swift 5:
import Foundation
import UIKit
class HighlightOnSelectCustomButton: UIButton {
override var isHighlighted: Bool {
didSet {
if (self.isSelected != isHighlighted) {
self.isHighlighted = self.isSelected
}
}
}
}