Remove unneeded #available and @available.

This commit is contained in:
Brent Simmons
2024-11-11 22:03:32 -08:00
parent 8a611f4109
commit a8eb75c20f
13 changed files with 204 additions and 536 deletions

View File

@@ -14,7 +14,6 @@ class MasterTimelineTitleView: UIView {
@IBOutlet weak var label: UILabel!
@IBOutlet weak var unreadCountView: MasterTimelineUnreadCountView!
@available(iOS 13.4, *)
private lazy var pointerInteraction: UIPointerInteraction = {
UIPointerInteraction(delegate: self)
}()
@@ -35,24 +34,18 @@ class MasterTimelineTitleView: UIView {
func buttonize() {
heightAnchor.constraint(equalToConstant: 40.0).isActive = true
accessibilityTraits = .button
if #available(iOS 13.4, *) {
addInteraction(pointerInteraction)
}
addInteraction(pointerInteraction)
}
func debuttonize() {
heightAnchor.constraint(equalToConstant: 40.0).isActive = true
accessibilityTraits.remove(.button)
if #available(iOS 13.4, *) {
removeInteraction(pointerInteraction)
}
removeInteraction(pointerInteraction)
}
}
extension MasterTimelineTitleView: UIPointerInteractionDelegate {
@available(iOS 13.4, *)
func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
var rect = self.frame
rect.origin.x = rect.origin.x - 10
@@ -60,5 +53,4 @@ extension MasterTimelineTitleView: UIPointerInteractionDelegate {
return UIPointerStyle(effect: .automatic(UITargetedPreview(view: self)), shape: .roundedRect(rect))
}
}