Latest 1.0.4
Homepage https://github.com/amirdew/AMTooltip
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Screenshots

AMTooltipAMTooltip

Requirements

iOS 8+

Expample write in Xcode 8.3 – Swift 3.1

Installation

AMTooltip is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "AMTooltip"

Usage (swift 3)

import AMTooltip

With focus view and default options:

          AMTooltipView(message: "some text",
                        focusView: focusView, //pass view you want show tooltip over it
                        target: self)  //you can pass UIViewController or UIView as target

With focus frame and default options:

          AMTooltipView(message: "some text",
                        focusFrame: CGRect(x:100, y:150, width:40, height:25)
                        target: self) 

With custom options:


          AMTooltipView(
            options:AMTooltipViewOptions(
                textColor: UIColor.white,
                textBoxBackgroundColor: UIColor.gray,
                addOverlayView: false,
                lineColor: UIColor.gray,
                dotColor: UIColor.lightGray,
                dotBorderColor: UIColor.gray
            ),
            message: "some customized text",
            focusView: focusView,
            target: self)

With dismiss closure:


        AMTooltipView(message: "some text",
                      focusView: focusView,
                      target: self) {

                        print("tooltip dismissed") 
        }

Options

Name Type Default Description
side AMTooltipViewSide .auto|Side of show tooltip (.auto/.top/.bottom)
textColor UIColor UIColor.black Color of message text
textWidth CGFloat 270 Width of message
font UIFont UIFont.systemFont(ofSize: 14) Font of message text
textAlignment NSTextAlignment .natural Alignment of message text
textBoxBackgroundColor UIColor UIColor.white Color of message box
textBoxCornerRadius CGFloat 6 Radius for corners of message box
textBoxBorderColor UIColor UIColor.clear Color for border of message box
textBoxBorderWidth CGFloat 0 Width for border of message box
addOverlayView Bool true if false dark overlay view hide
overlayBackgroundColor UIColor UIColor.black.withAlphaComponent(0.4) Color of overlay view
lineColor UIColor UIColor.white Color of pin line view
lineWidth CGFloat 2 Width of pin line view
lineHeight CGFloat 30 Height of pin line view
dotColor UIColor UIColor.lightGray Color of pin dot
dotSize CGFloat 13 Size of pin dot
dotBorderWidth CGFloat 2 Size for border of pin dot
dotBorderColor UIColor UIColor.white Color for border of pin dot
focusViewRadius CGFloat 6 Radius for corners of focused view
focustViewVerticalPadding CGFloat 5 Vertical padding for focused view
focustViewHorizontalPadding CGFloat 15 Horizontal padding for focused view

Todo

  • Add support for screen rotate
  • Adjust messageBox with target view frame
  • Support left and right side
  • Custom animations
  • Custom pointers (arrow, images, …)
  • Custom view instead tooltip box

License

AMTooltip is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "AMTooltip",
    "version": "1.0.4",
    "summary": "Simple library to show tooltip.",
    "description": "simple and easy library to show tooltip.",
    "homepage": "https://github.com/amirdew/AMTooltip",
    "screenshots": [
        "https://raw.githubusercontent.com/amirdew/AMTooltip/master/Example/screenshots_1.png",
        "https://raw.githubusercontent.com/amirdew/AMTooltip/master/Example/screenshots_2.png"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "amir khorsandi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/amirdew/AMTooltip.git",
        "tag": "1.0.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AMTooltip/Classes/**/*",
    "resource_bundles": {
        "AMTooltip": [
            "AMTooltip/Assets/*.xib"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This