mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Silence Sendable warnings in TVRemoteHoldSeekOverlay
Annotate makeCoordinator/makeUIView/updateUIView as @MainActor so reading the @MainActor-typed onTick closure stays within MainActor isolation and no longer triggers a Sendable conversion warning.
This commit is contained in:
@@ -26,10 +26,12 @@ struct TVRemoteHoldSeekOverlay: UIViewRepresentable {
|
|||||||
let isActive: Bool
|
let isActive: Bool
|
||||||
let onTick: TVRemoteHoldSeekTick
|
let onTick: TVRemoteHoldSeekTick
|
||||||
|
|
||||||
|
@MainActor
|
||||||
func makeCoordinator() -> Coordinator {
|
func makeCoordinator() -> Coordinator {
|
||||||
Coordinator(onTick: onTick)
|
Coordinator(onTick: onTick)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
func makeUIView(context: Context) -> UIView {
|
func makeUIView(context: Context) -> UIView {
|
||||||
let view = TVRemoteHoldSeekHostView()
|
let view = TVRemoteHoldSeekHostView()
|
||||||
view.backgroundColor = .clear
|
view.backgroundColor = .clear
|
||||||
@@ -38,6 +40,7 @@ struct TVRemoteHoldSeekOverlay: UIViewRepresentable {
|
|||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
func updateUIView(_: UIView, context: Context) {
|
func updateUIView(_: UIView, context: Context) {
|
||||||
context.coordinator.update(onTick: onTick, isActive: isActive)
|
context.coordinator.update(onTick: onTick, isActive: isActive)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user