All Projects → ZionChang → Popoverkit

ZionChang / Popoverkit

Licence: mit
A lightweight, swift library for displaying popover.

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Popoverkit

yuanful-ui
(微信小程序插件) yuanful-ui是一套可添加到微信小程序内直接使用的免费功能插件,无需重复开发,为用户提供更丰富的服务。
Stars: ✭ 30 (+3.45%)
Mutual labels:  popover
Ftpopovermenu swift
FTPopOverMenu_Swift, swift version of FTPopOverMenu. FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
Stars: ✭ 326 (+1024.14%)
Mutual labels:  popover
Kuipopover
Easy to use PopOver in iOS
Stars: ✭ 571 (+1868.97%)
Mutual labels:  popover
Popover
Custom macOS Popover 💬
Stars: ✭ 71 (+144.83%)
Mutual labels:  popover
Tltransitions
快速实现控制器的转场和View的快速popover显示,并支持自定义动画、手势退场
Stars: ✭ 296 (+920.69%)
Mutual labels:  popover
Vue Popper
🐳 VueJS popover component based popper.js
Stars: ✭ 359 (+1137.93%)
Mutual labels:  popover
SPStorkController
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,515 (+8572.41%)
Mutual labels:  popover
Share This
Medium-like text selection sharing without dependencies
Stars: ✭ 787 (+2613.79%)
Mutual labels:  popover
Popper Core
🍿 JavaScript positioning library for tooltips, popovers, dropdowns, and more
Stars: ✭ 18,903 (+65082.76%)
Mutual labels:  popover
React Laag
Hooks to build things like tooltips, dropdown menu's and popovers in React
Stars: ✭ 568 (+1858.62%)
Mutual labels:  popover
vue-popover
Reusable popover component for Vue
Stars: ✭ 22 (-24.14%)
Mutual labels:  popover
Tooltip Sequence
A simple step by step tooltip helper for any site
Stars: ✭ 287 (+889.66%)
Mutual labels:  popover
Pmcalendar
Yet another calendar component for iOS. Compatible with iOS 4.0 (iPhone & iPad) and higher. Supports presenting as a popover and very flexible UI tuning. Default theme is inspired by https://github.com/ocrickard/OCCalendar
Stars: ✭ 383 (+1220.69%)
Mutual labels:  popover
Bootstrap-Confirmation
Bootstrap plugin for on-place confirm boxes using Popover
Stars: ✭ 303 (+944.83%)
Mutual labels:  popover
Ngx Bootstrap
Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
Stars: ✭ 5,343 (+18324.14%)
Mutual labels:  popover
react-popover
Customizable positioning for tooltips, menus, and any other DOM elements inside of a container
Stars: ✭ 13 (-55.17%)
Mutual labels:  popover
Cool ui
用flutter实现一些我认为好看的UI控件,有Popover,仿Weui的Toast,自定义键盘
Stars: ✭ 349 (+1103.45%)
Mutual labels:  popover
Sveltejs Tippy
Tippy.js for Svelte
Stars: ✭ 26 (-10.34%)
Mutual labels:  popover
Popover
一款优雅易用的类似QQ和微信消息页面的右上角微型菜单弹窗
Stars: ✭ 732 (+2424.14%)
Mutual labels:  popover
React Cool Portal
😎 🍒 React hook for Portals, which renders modals, dropdowns, tooltips etc. to <body> or else.
Stars: ✭ 458 (+1479.31%)
Mutual labels:  popover

PopoverKit

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

PopoverTableViewController

  • Init your model(PureTitleModel or NormalModel)
let sortByDate = PureTitleModel(title: "按时间排序")
let sortBySize = PureTitleModel(title: "按大小排序")
let edit = NormalModel(iconName: "ic_note_edit", description: "编辑")
let delete = NormalModel(iconName: "ic_note_delete", description: "删除")

  • Init PopoverTableViewController
let vc = PopoverTableViewController(items: [sortByDate, sortBySize])
vc.pop.isNeedPopover = true
vc.pop.popoverPresentationController?.barButtonItem = sender
vc.pop.popoverPresentationController?.arrowPointY = self.navigationController?.navigationBar.frame.maxY
vc.delegate = self
present(vc, animated: true, completion: nil)
  • Or custom your own model(PopoverCellConfiguration)
/// Custom
struct CustomModel: PopoverCellConfiguration {
    
	public var width: CGFloat {
	    let cell = AjustFontPopoverCell()
	    config(cell: cell)
	    let width = cell.systemLayoutSizeFitting(UILayoutFittingCompressedSize).width
	    return width
	}
	    
	public var resuable: PopoverCellResuable.Type {
	    return AjustFontPopoverCell.self
	}
	    
	public func config(cell: UITableViewCell) {
	    guard let cell  = cell as? AjustFontPopoverCell else {
	        return
	    }
	    // config delegate...
	}
    
    
}

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+
  • Swift4

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 "ZionChang/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.2.0'

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].