Skip to content

yippeeapp/Popover

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Popover

CI Status Version License Platform

Description and appetize.io`s DEMO

Usage

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

Simple

let startPoint = CGPoint(x: self.view.frame.width - 60, y: 55)
let aView = UIView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 180))
var popover = Popover()
popover.show(aView, point: startPoint)

Custom

@IBOutlet weak var leftBottomButton: UIButton!

let width = self.view.frame.width / 4
let aView = UIView(frame: CGRect(x: 0, y: 0, width: width, height: width))
let options = [
  .Type(.Up),
  .CornerRadius(width / 2),
  .AnimationIn(0.3),
  .BlackOverlayColor(UIColor.redColor()),
  .ArrowSize(CGSizeZero)
  ] as [PopoverOption]
var popover = Popover(options: options, showHandler: {
  println("showHandler")
  }, dismissHandler: {
    println("dismissHandler")
})
popover.show(aView, fromView: self.leftBottomButton)

Requirements

  • iOS 7.0+
  • Swift1.2

Installation

CocoaPods(iOS 8+)

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

use_frameworks!
pod "Popover"

Carthage (iOS 8+)

You can use Carthage to install Popover by adding it to your Cartfile:

github "corin8823/Popover"

Manual Installation

The class file required for Popover is located in the Classes folder in the root of this repository as listed below:

Popover.swift

Customization

  • case ArrowSize(CGSize)
  • case AnimationIn(NSTimeInterval)
  • case AnimationOut(NSTimeInterval)
  • case CornerRadius(CGFloat)
  • case SideEdge(CGFloat)
  • case BlackOverlayColor(UIColor)
  • case Type(Popover.PopoverType)

Acknowledgments

Inspired by DXPopover in xiekw2010

License

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

About

Popover is a balloon library like Facebook app. It is written in pure swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 94.8%
  • Ruby 5.2%