Skip to content

Creating customizable and animated tooltips in UIKit🍏

License

Notifications You must be signed in to change notification settings

mini-min/ToolTipKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToolTipKit

Creating customizable and animated tooltips in UIKit🍏

Simulator Screen Recording - iPhone 16 Pro - 2025-01-05 at 13 57 36


Usage

Import

Import the Library ToolTipKit.

import ToolTipKit

Initialization

To create a tooltip, use the ToolTipView class

  • The tooltip supports the following directions:
    • .top: Tooltip appears above the source view.
    • .bottom: Tooltip appears below the source view.
    • .left: Tooltip appears to the left of the source view.
    • .right: Tooltip appears to the right of the source view.
lazy var tooltip = ToolTipView(
    title: "This is a tooltip!",
    type: .top,
    sourceItem: yourSourceView,   // Attach to your target UIView
)

Control

  • Show the Tooltip
tooltip.show()
  • Hide the Tooltip
tooltip.hide()
  • Show Tooltip with Timeout
tooltip.showWithTimeout(duration: 3) // Tooltip disappears after 3 seconds
  • Customize the colors using the following properties
tooltip.baseBackgroundColor = .blue
tooltip.baseForegroundColor = .yellow

Installation

Using Swift Package Manager

  1. In Xcode, go to File > Add Packages.
  2. Enter the repository URL: https://github.com/your-repo/ToolTipKit.git.
  3. Choose the version or branch you want to integrate.

License

ToolTipKit is released under the MIT License. Feel free to use it in your projects!
See the LICENSE file for more info

About

Creating customizable and animated tooltips in UIKit🍏

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages