BubbleSpot is a lightweight library for creating tooltips in iOS development using UIKit. It allows developers to easily add informative tooltips to their app's user interface, enhancing user experience and providing helpful hints.

- Easily create customizable tooltips for iOS apps.
- Support for positioning tooltips relative to target views.
- Customizable text, background color, arrow color, and more.
- Simple API for showing and dismissing tooltips.
BubbleSpot can be easily integrated into your iOS project using Swift Package Manager.
- In Xcode, select "File" > "Swift Packages" > "Add Package Dependency..."
- Enter the BubbleSpot GitHub repository URL:
https://github.com/agustiyann/BubbleSpot.git
- Follow the prompts to complete the installation.
To use BubbleSpot in your project, follow these simple steps:
- Import the BubbleSpot module wherever you plan to use it:
import BubbleSpot
- Create a BubbleSpot instance with the target view, tooltip text, and bubble position:
let bubble = BubbleSpot(targetView: targetView, text: "Your tooltip text here", bubblePosition: .top)
- Customize the tooltip appearance (optional):
bubble.backgroundColor = .black
bubble.textColor = .white
bubble.arrowColor = .black
- Show the tooltip:
bubble.show()
- Dismiss the tooltip (optional):
bubble.dismiss()
Here's a simple example demonstrating how to use BubbleSpot:
import UIKit
import BubbleSpot
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Create a target view
let button = UIButton(type: .system)
button.setTitle("Tap me", for: .normal)
button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(button)
// Add constraints for the button
NSLayoutConstraint.activate([
button.centerXAnchor.constraint(equalTo: view.centerXAnchor),
button.centerYAnchor.constraint(equalTo: view.centerYAnchor)
])
}
@objc func buttonTapped() {
// Create and show a tooltip
let bubble = BubbleSpot(targetView: view, text: "This is a tooltip", bubblePosition: .top)
bubble.show()
}
}
Contributions to BubbleSpot are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
BubbleSpot is available under the MIT license. See the LICENSE file for more information.