Skip to content

PTBalloonView and PTBalloonLabel are the view and label, like balloon.

License

Notifications You must be signed in to change notification settings

pjocprac/PTBalloonView

Repository files navigation

PTBalloonView / PTBalloonLabel

Version License Platform

PTBalloonView and PTBalloonLabel are the view and label, like balloon. It is easy to use this balloon view and label. And it can be set balloon's inflating and deflating animations.

PTBalloonView PTBalloonLabel
PTBalloonView PTBalloonLabel

Description

PTBalloonView is a simple popup view like a balloon. The contentView property is used for your view to be shown in a balloon.

PTBalloonLabel is a simple popup label, which is subclass of PTBalloonView. It have additional properties, title, text, and buttons, instead of contentView.

Requirements

iOS 8.0

Installation

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

pod "PTBalloonView"

Usage

At first, to popup balloon view is only code below. (shows empty balloon.)

let balloonView = PTBalloonView()
balloonView
    .contentView(UIView(frame: CGRectMake(0, 0, 120, 80))) // replace to your content view
    .inflate(TARGET_VIEW) // replace TARGET_VIEW to target view

and deflate balloon is only code below.

balloonView.deflate()

To popup PTBalloonLabel.

let balloonLabel = PTBalloonLabel()
balloonLabel
    .title("PTBalloonLabel Demo")
    .text("This balloon is PTBalloonLabel Demo")
    .addButton(title: "close", type: .Close)
    .inflate(TARGET_VIEW) // replace TARGET_VIEW to target view

Details, see the Demo and the Class Reference.

Balloon Style

To change balloon's style, you can use methods (named same as properties).

Balloon Animations

To change balloon's animations, inflateAnimation() and deflatingAnimation() methods can be used.

Class Reference

Class Reference

Demo

To run the example project, clone the repo, and run pod install from the Example directory first.

Balloon Animation

Balloon's pumping up and deflating animations can be selected.

Pop PopShift Fade
Pop PopShift Fade
FadeShift Revolution RevolutionShift
FadeShift Revolution RevolutionShift
Slide (can choose direction)
Slide

Target Animation

Target view's animations can be selected also. (It applies only when balloon inflating.)

Pop Blink Rotation Sway
Target Pop Target Blink Target Rotation Target Sway

Author

Takeshi Watanabe, [email protected]

License

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

About

PTBalloonView and PTBalloonLabel are the view and label, like balloon.

Resources

License

Stars

Watchers

Forks

Packages

No packages published