-
Notifications
You must be signed in to change notification settings - Fork 3
feat: swiftui tooltip #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new SwiftUI tooltip library called TooltipKitUI, complementing the existing UIKit-based ToolTipKit. The implementation provides a declarative API for adding customizable tooltips to SwiftUI views with features like automatic positioning, highlight effects, and extensive styling options.
Key Changes
- Added complete TooltipKitUI module with SwiftUI-based tooltip implementation supporting iOS 14+
- Implemented custom shape rendering for tooltips with dynamic arrow positioning
- Created comprehensive documentation with usage examples and configuration parameters in README
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/TooltipKitUI/Views/TooltipOverlay.swift | Core positioning logic for tooltips with automatic placement above/below targets |
| Sources/TooltipKitUI/Views/TooltipKitUI.swift | Main tooltip view component with title/description rendering |
| Sources/TooltipKitUI/Views/TooltipContainer.swift | Container wrapper that manages tooltip presentation and overlay |
| Sources/TooltipKitUI/Utils/TooltipPreferenceKey.swift | SwiftUI preference key for passing tooltip data up the view hierarchy |
| Sources/TooltipKitUI/Shapes/TooltipShape.swift | Custom shape drawing rounded rectangles with directional arrows |
| Sources/TooltipKitUI/Modifiers/TooltipModifier.swift | View modifier extension providing .tooltip() API for any SwiftUI view |
| Sources/TooltipKitUI/Models/TooltipPreferenceData.swift | Data model for tooltip preference values with frame and config |
| Sources/TooltipKitUI/Models/TooltipConfig.swift | Configuration struct with customization options and ArrowDirection enum |
| Sources/TooltipKitUI/Manager/TooltipManager.swift | State manager for tooltip dismissal coordination |
| Sample/Sample/ViewController.swift | Added button to navigate to SwiftUI preview screen |
| Sample/Sample/SwiftUI/TooltipPreviewScreen.swift | Interactive demo screen for testing tooltip customization |
| Sample/Sample.xcodeproj/project.pbxproj | Project file updates to include new SwiftUI files and TooltipKitUI dependency |
| README.md | Comprehensive documentation for TooltipKitUI with API reference and examples |
| Package.swift | Added TooltipKitUI library target to Swift package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.