drop iOS 17 and removed all #available and #unavaible checks for 17 and 18

This commit is contained in:
Mauro Romito
2025-11-28 14:37:37 +01:00
committed by Mauro
parent 7496f30966
commit 656648fc7c
12 changed files with 79 additions and 160 deletions
@@ -21,25 +21,19 @@ struct TimelineItemMacContextMenu: View {
if let menuActions = actionProvider.makeActions() {
Section {
if !menuActions.reactions.isEmpty {
if #available(iOS 17.0, *) {
let reactions = (item as? EventBasedTimelineItemProtocol)?.properties.reactions ?? []
ControlGroup {
ForEach(menuActions.reactions, id: \.key) {
ReactionToggle(reaction: $0, reactions: reactions) {
send(.toggleReaction(key: $0))
}
}
Button { send(.react) } label: {
CompoundIcon(\.reactionAdd)
let reactions = (item as? EventBasedTimelineItemProtocol)?.properties.reactions ?? []
ControlGroup {
ForEach(menuActions.reactions, id: \.key) {
ReactionToggle(reaction: $0, reactions: reactions) {
send(.toggleReaction(key: $0))
}
}
.controlGroupStyle(.palette)
} else {
Button { send(.react) } label: {
TimelineItemMenuAction.react.label
CompoundIcon(\.reactionAdd)
}
}
.controlGroupStyle(.palette)
}
ForEach(menuActions.actions) { action in
@@ -53,7 +53,7 @@ struct TimelineItemMenu: View {
}
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.timelineItemActionMenu)
.backportPresentationSizingPage()
.presentationSizing(.page)
.presentationDetents([.medium, .large])
.presentationBackground(Color.compound.bgCanvasDefault)
.presentationDragIndicator(.visible)
@@ -94,8 +94,7 @@ struct PollView: View {
private var optionsView: some View {
ForEach(poll.options, id: \.id) { option in
pollOption(option: option)
.backportAccessibilityHint(L10n.a11yPollsWillRemoveSelection,
isEnabled: isRemovePreviousSelectionHintEnabled(option: option))
.accessibilityHint(L10n.a11yPollsWillRemoveSelection, isEnabled: isRemovePreviousSelectionHintEnabled(option: option))
}
}
@@ -16,26 +16,19 @@ struct LongPressWithFeedback: ViewModifier {
private let feedbackGenerator = UIImpactFeedbackGenerator(style: .heavy)
func body(content: Content) -> some View {
if #available(iOS 18, *) {
mainContent(content: content)
.gesture(LongPressGestureRepresentable { gesture in
switch gesture.state {
case .began:
handleLongPress(isPressing: true)
case .ended, .cancelled, .failed:
handleLongPress(isPressing: false)
case .possible, .changed:
break
@unknown default:
break
}
})
} else {
mainContent(content: content)
.onLongPressGesture(minimumDuration: 0.25) { } onPressingChanged: { isPressing in
handleLongPress(isPressing: isPressing)
mainContent(content: content)
.gesture(LongPressGestureRepresentable { gesture in
switch gesture.state {
case .began:
handleLongPress(isPressing: true)
case .ended, .cancelled, .failed:
handleLongPress(isPressing: false)
case .possible, .changed:
break
@unknown default:
break
}
}
})
}
// The gesture's minimum duration doesn't actually invoke the perform block when elapsed (thus