Skip to content

Commit 95261cf

Browse files
committed
Added UIKit .onHover + minor consistency improvement | fixed minor Naming fixes in AppKitBackend
- tapGestureRecognizer and longPressGestureRecognizer now get removed if their corresponding handler is set to nil. - Added Hoverable Widget - Added hovertarget creation & update functions - added macCalatalyst as compatible for UISlider since it supports it
1 parent 1113eaa commit 95261cf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Examples/Sources/HoverExample/HoverApp.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ struct CellView: View {
3636
.onHover { hovering in
3737
if !hovering {
3838
timer = Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { timer in
39-
if opacity >= 0.05 {
40-
opacity -= 0.05
41-
} else {
42-
opacity = 0.0
43-
timer.invalidate()
39+
DispatchQueue.main.async {
40+
if opacity >= 0.05 {
41+
opacity -= 0.05
42+
} else {
43+
opacity = 0.0
44+
timer.invalidate()
45+
}
4446
}
4547
}
4648
} else {

0 commit comments

Comments
 (0)