diff --git a/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift b/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift index e83c5fba3..c2875385c 100644 --- a/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift +++ b/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift @@ -173,7 +173,7 @@ extension MapLibreMapView { } func mapView(_ mapView: MGLMapView, regionDidChangeAnimated animated: Bool) { - // Fixes: "Publishing changes from within view updates is not allowed, this will cause undefined behavior." + // Avoid `Publishing changes from within view update` warnings DispatchQueue.main.async { [mapLibreView] in mapLibreView.mapCenterCoordinate = mapView.centerCoordinate } diff --git a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift index aa96fd96f..395b1cfdd 100644 --- a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift +++ b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift @@ -89,7 +89,7 @@ private struct CallView: UIViewRepresentable { super.init() - DispatchQueue.main.async { // Avoid `Publishing changes from within view update warnings` + DispatchQueue.main.async { // Avoid `Publishing changes from within view update` warnings viewModelContext.javaScriptEvaluator = self.evaluateJavaScript viewModelContext.requestPictureInPictureHandler = self.requestPictureInPicture } diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift index 7659516ea..b760bd555 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift @@ -189,8 +189,11 @@ private class ElementTextView: UITextView, PillAttachmentViewProviderDelegate { super.init(frame: .zero, textContainer: nil) - presendCallback.wrappedValue = { [weak self] in - self?.acceptCurrentSuggestion() + // Avoid `Publishing changes from within view update` warnings + DispatchQueue.main.async { + presendCallback.wrappedValue = { [weak self] in + self?.acceptCurrentSuggestion() + } } } diff --git a/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift b/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift index b537d4b98..ee3289bbc 100644 --- a/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift +++ b/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift @@ -131,7 +131,7 @@ class TimelineTableViewController: UIViewController { /// Updates the typing members but also updates table view items func setTypingMembers(_ members: [String]) { DispatchQueue.main.async { - // Avoid `Publishing changes from within view update warnings` + // Avoid `Publishing changes from within view update` warnings self.typingMembers.members = members } }