remove iOS 16 support (#3443)

* remove iOS 16 support

* remove iOS 16 support

* test updates

* added more delay

* revert

* adding waiting time on the CI
This commit is contained in:
Mauro
2024-10-24 17:21:28 +02:00
committed by GitHub
parent 926924912f
commit 7d373c07a3
51 changed files with 91 additions and 91 deletions
@@ -575,7 +575,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
// The user will log out, clear any existing notifications and unregister from receving new ones
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
UIApplication.shared.applicationIconBadgeNumber = 0
UNUserNotificationCenter.current().setBadgeCount(0)
unregisterForRemoteNotifications()
@@ -452,15 +452,15 @@ private struct NavigationSplitCoordinatorView: View {
}
// Handle `horizontalSizeClass` changes breaking the navigation bar
// https://github.com/element-hq/element-x-ios/issues/617
.onChange(of: horizontalSizeClass) { value in
.onChange(of: horizontalSizeClass) { _, newValue in
guard scenePhase != .background else {
return
}
isInSplitMode = value == .regular
isInSplitMode = newValue == .regular
}
.onChange(of: scenePhase) { value in
guard value == .active else {
.onChange(of: scenePhase) { _, newValue in
guard newValue == .active else {
return
}
+1 -1
View File
@@ -30,7 +30,7 @@ struct PillView: View {
.padding(.trailing, 6)
.padding(.vertical, 1)
.background { Capsule().foregroundColor(backgroundColor) }
.onChange(of: context.viewState.displayText) { _ in
.onChange(of: context.viewState.displayText) {
didChangeText()
}
}
+1 -1
View File
@@ -171,7 +171,7 @@ struct IsSearchingModifier: ViewModifier {
func body(content: Content) -> some View {
content
.onChange(of: isSearchingEnv) { isSearching = $0 }
.onChange(of: isSearchingEnv) { isSearching = $1 }
}
}
@@ -29,7 +29,7 @@ struct AppLockScreen: View {
pinInputField
.padding(.bottom, 16)
.offset(x: pinInputFieldOffset)
.onChange(of: context.viewState.numberOfPINAttempts) { newValue in
.onChange(of: context.viewState.numberOfPINAttempts) { _, newValue in
guard newValue > 0 else { return } // Reset without animation in Previews.
accessibilitySubtitleFocus = true
Task { await animatePINFailure() }
@@ -20,7 +20,7 @@ struct PINTextField: View {
.textFieldStyle(PINTextFieldStyle(pinCode: pinCode, isSecure: isSecure, maxLength: maxLength, size: size))
.keyboardType(.numberPad)
.accessibilityIdentifier(A11yIdentifiers.appLockSetupPINScreen.textField)
.onChange(of: pinCode) { newValue in
.onChange(of: pinCode) { _, newValue in
let sanitized = sanitize(newValue)
if sanitized != newValue {
MXLog.warning("PIN code input sanitized.")
@@ -29,7 +29,7 @@ struct AppLockSetupSettingsScreen: View {
Section {
ListRow(label: .plain(title: context.viewState.enableBiometricsTitle),
kind: .toggle($context.enableBiometrics))
.onChange(of: context.enableBiometrics) { _ in
.onChange(of: context.enableBiometrics) {
context.send(viewAction: .enableBiometricsChanged)
}
}
@@ -74,7 +74,9 @@ struct LoginScreen: View {
.textContentType(.username)
.autocapitalization(.none)
.submitLabel(.next)
.onChange(of: isUsernameFocused, perform: usernameFocusChanged)
.onChange(of: isUsernameFocused) { _, newValue in
usernameFocusChanged(isFocussed: newValue)
}
.onSubmit { isPasswordFocused = true }
.padding(.bottom, 20)
@@ -135,19 +137,19 @@ struct LoginScreen_Previews: PreviewProvider, TestablePreview {
LoginScreen(context: viewModel.context)
}
.previewDisplayName("matrix.org")
.snapshotPreferences(delay: 0.1)
.snapshotPreferences(delay: 1)
NavigationStack {
LoginScreen(context: credentialsViewModel.context)
}
.previewDisplayName("Credentials Entered")
.snapshotPreferences(delay: 0.1)
.snapshotPreferences(delay: 1)
NavigationStack {
LoginScreen(context: unconfiguredViewModel.context)
}
.previewDisplayName("Unsupported")
.snapshotPreferences(delay: 0.1)
.snapshotPreferences(delay: 1)
}
static func makeViewModel(homeserverAddress: String = "matrix.org", withCredentials: Bool = false) -> LoginScreenViewModel {
@@ -59,7 +59,7 @@ struct ServerSelectionScreen: View {
.keyboardType(.URL)
.autocapitalization(.none)
.disableAutocorrection(true)
.onChange(of: context.homeserverAddress) { _ in context.send(viewAction: .clearFooterError) }
.onChange(of: context.homeserverAddress) { context.send(viewAction: .clearFooterError) }
.submitLabel(.done)
.onSubmit(submit)
@@ -107,7 +107,7 @@ struct ServerSelection_Previews: PreviewProvider, TestablePreview {
NavigationStack {
ServerSelectionScreen(context: invalidViewModel.context)
}
.snapshotPreferences(delay: 0.25)
.snapshotPreferences(delay: 1)
}
static func makeViewModel(for homeserverAddress: String) -> ServerSelectionScreenViewModel {
@@ -30,7 +30,7 @@ struct BugReportScreen: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar { toolbar }
.interactiveDismissDisabled()
.onChange(of: selectedScreenshot) { newItem in
.onChange(of: selectedScreenshot) { _, newItem in
Task {
guard let data = try? await newItem?.loadTransferable(type: Data.self),
let image = UIImage(data: data)
@@ -65,8 +65,8 @@ struct PollFormScreen: View {
}
.focused($focus, equals: .option(index: index))
.accessibilityIdentifier(A11yIdentifiers.pollFormScreen.optionID(index))
.onChange(of: context.options[index].text) { optionText in
guard let lastCharacter = optionText.last, lastCharacter.isNewline else {
.onChange(of: context.options[index].text) { _, newOptionText in
guard let lastCharacter = newOptionText.last, lastCharacter.isNewline else {
return
}
@@ -55,7 +55,7 @@ struct EmojiPickerScreen: View {
}
.presentationDetents([.medium, .large])
.presentationDragIndicator(isSearching ? .hidden : .visible)
.onChange(of: searchString) { _ in
.onChange(of: searchString) {
context.send(viewAction: .search(searchString: searchString))
}
}
@@ -49,7 +49,7 @@ struct GlobalSearchScreen: View {
selectedRoom = context.viewState.rooms.first
searchFieldFocus = true
}
.onChange(of: context.viewState.rooms) { _ in
.onChange(of: context.viewState.rooms) {
selectedRoom = context.viewState.rooms.first
}
.onTapGesture {
@@ -66,10 +66,10 @@ struct HomeScreenContent: View {
.onReceive(scrollViewAdapter.isScrolling) { _ in
updateVisibleRange()
}
.onChange(of: context.searchQuery) { _ in
.onChange(of: context.searchQuery) {
updateVisibleRange()
}
.onChange(of: context.viewState.visibleRooms) { _ in
.onChange(of: context.viewState.visibleRooms) {
updateVisibleRange()
// We have been seeing a lot of issues around the room list not updating properly after
@@ -110,7 +110,7 @@ struct InviteUsersScreen: View {
.frame(width: cellWidth)
}
}
.onChange(of: context.viewState.scrollToLastID) { lastAddedID in
.onChange(of: context.viewState.scrollToLastID) { _, lastAddedID in
guard let id = lastAddedID else { return }
withElementAnimation(.easeInOut) {
scrollView.scrollTo(id)
@@ -107,7 +107,7 @@ struct JoinRoomScreen: View {
VStack(alignment: .leading, spacing: 12) {
HStack(spacing: 0) {
TextField("", text: $context.knockMessage, axis: .vertical)
.onChange(of: context.knockMessage) { newValue in
.onChange(of: context.knockMessage) { _, newValue in
context.knockMessage = String(newValue.prefix(1000))
}
.lineLimit(4, reservesSpace: true)
@@ -108,7 +108,7 @@ struct IdentityConfirmationScreen_Previews: PreviewProvider, TestablePreview {
NavigationStack {
IdentityConfirmationScreen(context: viewModel.context)
}
.snapshotPreferences(delay: 0.25)
.snapshotPreferences(delay: 1)
}
private static var viewModel: IdentityConfirmationScreenViewModel {
@@ -71,8 +71,8 @@ struct RoomChangeRolesScreen: View {
.frame(width: cellWidth)
}
}
.onChange(of: context.viewState.lastPromotedMember) { member in
guard let member else { return }
.onChange(of: context.viewState.lastPromotedMember) { _, newValue in
guard let member = newValue else { return }
withElementAnimation(.easeInOut) {
scrollView.scrollTo(member.id)
}
@@ -185,7 +185,7 @@ struct RoomDetailsScreen: View {
ListRow(label: .default(title: L10n.commonFavourite, icon: \.favourite),
kind: .toggle($context.isFavourite))
.accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.favourite)
.onChange(of: context.isFavourite) { newValue in
.onChange(of: context.isFavourite) { _, newValue in
context.send(viewAction: .toggleFavourite(isFavourite: newValue))
}
@@ -35,7 +35,7 @@ struct RoomNotificationSettingsScreen: View {
kind: .toggle($context.allowCustomSetting))
.accessibilityIdentifier(A11yIdentifiers.roomNotificationSettingsScreen.allowCustomSetting)
.disabled(context.viewState.notificationSettingsState.isLoading)
.onChange(of: context.allowCustomSetting) { _ in
.onChange(of: context.allowCustomSetting) {
context.send(viewAction: .changedAllowCustomSettings)
}
} footer: {
@@ -47,8 +47,8 @@ struct RoomPollsHistoryScreen: View {
}
.pickerStyle(.segmented)
.readableFrame(maxWidth: 475)
.onChange(of: context.filter) { value in
context.send(viewAction: .filter(value))
.onChange(of: context.filter) { _, newValue in
context.send(viewAction: .filter(newValue))
}
}
@@ -180,18 +180,18 @@ struct ComposerToolbar: View {
guard !composerFocused else { return }
composerFocused = true
}
.onChange(of: context.composerFocused) { newValue in
.onChange(of: context.composerFocused) { _, newValue in
guard composerFocused != newValue else { return }
composerFocused = newValue
}
.onChange(of: composerFocused) { newValue in
.onChange(of: composerFocused) { _, newValue in
context.composerFocused = newValue
}
.onChange(of: context.plainComposerText) { _ in
.onChange(of: context.plainComposerText) {
context.send(viewAction: .plainComposerTextChanged)
}
.onChange(of: context.composerFormattingEnabled) { _ in
.onChange(of: context.composerFormattingEnabled) {
context.send(viewAction: .didToggleFormattingOptions)
}
.onAppear {
@@ -48,8 +48,8 @@ struct VoiceMessagePreviewComposer: View {
showCursor: playerState.showProgressIndicator,
onSeek: onSeek)
}
.onChange(of: isDragging) { isDragging in
onScrubbing(isDragging)
.onChange(of: isDragging) { _, newValue in
onScrubbing(newValue)
}
.padding(.vertical, 4.0)
.padding(.horizontal, 6.0)
@@ -32,8 +32,8 @@ struct SwipeRightAction<Label: View>: ViewModifier {
.offset(x: xOffset, y: 0.0)
.animation(.interactiveSpring().speed(0.5), value: xOffset)
.timelineGesture(gesture)
.onChange(of: dragGestureActive) { value in
if value == true {
.onChange(of: dragGestureActive) { _, newValue in
if newValue == true {
if shouldStartAction() {
feedbackGenerator.prepare()
canStartAction = true
@@ -19,7 +19,7 @@ struct SecureBackupRecoveryKeyScreen: View {
ScrollViewReader { reader in
mainContent
.padding(16)
.onChange(of: focused) { newValue in
.onChange(of: focused) { _, newValue in
guard newValue == true else { return }
reader.scrollTo(textFieldIdentifier)
}
@@ -24,7 +24,7 @@ struct AnalyticsSettingsScreen: View {
Section {
ListRow(label: .plain(title: L10n.screenAnalyticsSettingsShareData),
kind: .toggle($context.enableAnalytics))
.onChange(of: context.enableAnalytics) { _ in
.onChange(of: context.enableAnalytics) {
context.send(viewAction: .toggleAnalytics)
}
} footer: {
@@ -86,7 +86,7 @@ struct NotificationSettingsScreen: View {
Section {
ListRow(label: .plain(title: L10n.screenNotificationSettingsEnableNotifications),
kind: .toggle($context.enableNotifications))
.onChange(of: context.enableNotifications) { _ in
.onChange(of: context.enableNotifications) {
context.send(viewAction: .changedEnableNotifications)
}
}
@@ -128,7 +128,7 @@ struct NotificationSettingsScreen: View {
kind: .toggle($context.roomMentionsEnabled))
.disabled(context.viewState.settings?.roomMentionsEnabled == nil)
.allowsHitTesting(!context.viewState.applyingChange)
.onChange(of: context.roomMentionsEnabled) { _ in
.onChange(of: context.roomMentionsEnabled) {
context.send(viewAction: .roomMentionChanged)
}
} header: {
@@ -143,7 +143,7 @@ struct NotificationSettingsScreen: View {
kind: .toggle($context.callsEnabled))
.disabled(context.viewState.settings?.callsEnabled == nil)
.allowsHitTesting(!context.viewState.applyingChange)
.onChange(of: context.callsEnabled) { _ in
.onChange(of: context.callsEnabled) {
context.send(viewAction: .callsChanged)
}
} header: {
@@ -158,7 +158,7 @@ struct NotificationSettingsScreen: View {
kind: .toggle($context.invitationsEnabled))
.disabled(context.viewState.settings?.invitationsEnabled == nil)
.allowsHitTesting(!context.viewState.applyingChange)
.onChange(of: context.invitationsEnabled) { _ in
.onChange(of: context.invitationsEnabled) {
context.send(viewAction: .invitationsChanged)
}
} header: {
@@ -377,11 +377,12 @@ struct TimelineItemBubbledStylerView_Previews: PreviewProvider, TestablePreview
.previewDisplayName("Replies")
threads
.previewDisplayName("Thread decorator")
.snapshotPreferences(delay: 1)
encryptionAuthenticity
.previewDisplayName("Encryption Indicators")
pinned
.previewDisplayName("Pinned messages")
.snapshotPreferences(delay: 2.0)
.snapshotPreferences(delay: 1)
}
static var mockTimeline: some View {
@@ -25,7 +25,7 @@ struct TimelineStyler<Content: View>: View {
var body: some View {
mainContent
.onChange(of: timelineItem.properties.deliveryStatus) { newStatus in
.onChange(of: timelineItem.properties.deliveryStatus) { _, newStatus in
if case .sendingFailed = newStatus {
guard task == nil else {
return
@@ -43,7 +43,7 @@ struct ReactionsSummaryView: View {
scrollView.scrollTo(selectedReactionKey)
}
}
.onChange(of: selectedReactionKey) { _ in
.onChange(of: selectedReactionKey) {
scrollView.scrollTo(selectedReactionKey)
}
}
@@ -19,7 +19,7 @@ struct TypingIndicatorView: View {
.truncationMode(.middle)
.padding(.horizontal, 4)
.animation(.elementDefault, value: typingMembers.members)
.onChange(of: typingMembers.members) { newValue in
.onChange(of: typingMembers.members) { _, newValue in
if !newValue.isEmpty {
didShowTextOnce = true
}
@@ -51,8 +51,8 @@ struct VoiceMessageRoomPlaybackView: View {
}
.padding(.leading, 2)
.padding(.trailing, 8)
.onChange(of: isDragging) { isDragging in
onScrubbing(isDragging)
.onChange(of: isDragging) { _, newValue in
onScrubbing(newValue)
}
}