Latest 0.0.2
Homepage https://github.com/eilianlove/PopoverKit
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

A lightweight, swift library for displaying popover.

Swift Version
Pod Version
Carthage compatible
License
Platform

Description

Usage

if you use PopoverKit

// Present the view controller using the popover style.        
myPopooverViewController.pop.isNeedPopover = true

// Get the popover presentation controller and configure it.
myPopooverViewController.pop.popoverPresentationController?.sourceView = sender
myPopooverViewController.pop.popoverPresentationController?.sourceRect = sender.bounds
myPopooverViewController.pop.popoverPresentationController?.arrowDirection = .up

if you use UIPopoverPresentationController(System)

// Present the view controller using the popover style.
myPopooverViewController.modalPresentationStyle = .popover
present(myPopooverViewController, animated: true, completion: nil)

// Get the popover presentation controller and configure it.
let presentationController = myPopooverViewController.popoverPresentationController
presentationController?.sourceView = myView
presentationController?.sourceRect = sourceRect

As you see, so esay, just like system

Customization

PopoverConfiguration

Property

public enum PopoverConfiguration.Animation {
    case scale
    case alpha
}
  • arrowSize = CGSize(width: 12, height: 7)
  • cornerRadius = CGFloat(4)
  • animationDuration = TimeInterval(0.25)
  • backgroundColor = UIColor.white
  • dimmingViewColor = UIColor.black.withAlphaComponent(0.35)
  • showDimmingView = true
  • animation: Animation = .scale

Requirements

  • iOS 8.0+
  • Xcode 8.0+

Installation

Carthage

Create a Cartfile that lists the framework. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/PopoverKit.framework to an iOS project.

github "eilianlove/PopoverKit"

Run carthage update to build the framework and drag the built PopoverKit.framework into your Xcode project.

To get the full benefits import PopoverKit

import PopoverKit

CocoaPods

You can use CocoaPods to install PopoverKit by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'PopoverKit', '~> 0.0.1'

Then, run the following command:

$ pod install

Manually

  1. Download and drop PopoverKit in your project.
  2. Congratulations!

TODO

  • [] Ability to customize animation

License

PopoverKit is licensed under the MIT License, please see the LICENSE file.

Latest podspec

{
    "name": "PopoverKit",
    "version": "0.0.2",
    "summary": "A lightweight, swift library for pop your viewcontroll.",
    "homepage": "https://github.com/eilianlove/PopoverKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "archerzz": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/eilianlove/PopoverKit.git",
        "tag": "0.0.2"
    },
    "source_files": "Sources/*.swift",
    "requires_arc": true,
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This