Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Perform an Action When The Mouse Cursor Enters a View With .onContinuousHover

Perform an Action When The Mouse Cursor Enters a View With .onContinuousHover

Daily Coding Tip 144

Millie Sturgeon's avatar
Millie Sturgeon
Aug 02, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Perform an Action When The Mouse Cursor Enters a View With .onContinuousHover
Share
assorted-color pebbles
Photo by Eric Prouzet on Unsplash

In a macOS app, it is possible to catch the event that occurs when the mouse cursor is inside the bounds of a view. Inside this closure there is an enum called HoverPhase. This has the .active case, which has the mouse location as a CGPoint associated type. Then it has an .ended case with no associated type, so we are on…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share