NiceHoverView is an elegant, customizable NSView subclass for macOS that adds smooth hover effects to enhance the interactivity of user interfaces in macOS applications.
Screen.Recording.2024-04-29.at.16.31.30.mov
- Customizable Appearance: Easily adjust colors, radii, and more.
- Smooth Animations: Smooth and responsive hover animations.
- Easy to Integrate: Minimal setup required to add to your project.
Use SMP To integrate NiceHoverView into your macOS project
To use NiceHoverView in your application, follow these simple steps:
import NiceHoverView
class YourCustomView: NiceHoverView {
override func hoverColor() -> NSColor {
return NSColor(white: 0, alpha: 0.1)
}
override func xRadius() -> CGFloat {
return 20
}
override func yRadius() -> CGFloat {
return 20
}
override func hoverRect() -> NSRect {
return bounds
}
}
// Initialize your view and add it to your window or view hierarchy
let customView = YourCustomView()
yourParentView.addSubview(customView)
import NiceHoverView
final class CustomTableRowView: NiceHoverTableRowView {
override func hoverColor() -> NSColor {
return NSColor(white: 0, alpha: 0.1)
}
override func xRadius() -> CGFloat {
return 20
}
override func yRadius() -> CGFloat {
return 20
}
override func hoverRect() -> NSRect {
return bounds
}
}
This workflow is open-source and available under the MIT License.
If you encounter any issues or have questions, please open an issues on this GitHub repository, and we'll be happy to assist you.