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

Related tags

Popup Popover
Overview

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))
let 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.red),
  .arrowSize(CGSize.zero)
  ] as [PopoverOption]
let popover = Popover(options: options, showHandler: nil, dismissHandler: nil)
popover.show(aView, fromView: self.leftBottomButton)

Requirements

  • iOS 9.0+
  • Swift 5

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

Enum

  • case arrowSize(CGSize)
  • case animationIn(NSTimeInterval)
  • case animationOut(NSTimeInterval)
  • case cornerRadius(CGFloat)
  • case sideEdge(CGFloat)
  • case blackOverlayColor(UIColor)
  • case overlayBlur(UIBlurEffectStyle)
  • case type(Popover.PopoverType)
  • case color(UIColor)
  • case dismissOnBlackOverlayTap(Bool)
  • case showBlackOverlay(Bool)

Property

  • arrowSize: CGSize = CGSize(width: 16.0, height: 10.0)
  • animationIn: NSTimeInterval = 0.6
  • animationOut: NSTimeInterval = 0.3
  • cornerRadius: CGFloat = 6.0
  • sideEdge: CGFloat = 20.0
  • popoverType: PopoverType = .down
  • blackOverlayColor: UIColor = UIColor(white: 0.0, alpha: 0.2)
  • overlayBlur: UIBlurEffect?
  • popoverColor: UIColor = UIColor.white

Acknowledgments

Inspired by DXPopover in xiekw2010

License

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

Issues
  • Not able to dismiss the popover

    Not able to dismiss the popover

    Hello, I am displaying a popover on a gesture recogniser. The popover shows a custom collectionview. But i am not able to dismiss the popover by using popover.dismiss.

    Here is my code:

    ` class KeyboardViewController: UIInputViewController , ISEmojiViewDelegate, UICollectionViewDelegate, UICollectionViewDataSource {

    var extras : [String] = []
    
    fileprivate var popover1: Popover!
    
    //setting up everything
    
    func ShowPop(_ sender: UILongPressGestureRecognizer) {
    	self.popover1 = Popover(options: [.type(.up), .showBlackOverlay(false)])
    	self.popover1.willShowHandler = {
    		print("willShowHandler")
    	}
    	self.popover1.didShowHandler = {
    		print("didshowHandler")
    	}
    	self.popover1.willDismissHandler = {
    		print("willDismissHandler")
    	}
    	self.popover1.didDismissHandler = {
    		print("didDismissHandler")
    	}
    	if sender.state == .began {
    		//get the button
    		if let button = sender.view as? UIButton {
    			switch button.tag {
    			case 50 : extras = ["è","é","ê","ë","ē"]
    						break
    			case 55 : extras = ["ì","í","î","ï"]
    						break
    			case 60 : extras = ["ò","ó","ô","õ","ö"]
    						break
    			case 65 : extras = ["à","á","â","ã","ä"]
    						break
    			case 70 : extras = ["È","É","Ê","Ë","Ē"]
    						break
    			case 75 : extras = ["Ì","Í","Î","Ï"]
    						break
    			case 80 : extras = ["Ò","Ó","Ô","Õ","Ö"]
    						break
    			case 85 : extras = ["À","Á","Â","Ã","Ä"]
    						break
    				default:
    						print("none")
    			} //end switch
    			let fl = UICollectionViewFlowLayout()
    			fl.minimumLineSpacing = 0
    			fl.minimumInteritemSpacing = 0
    			let width = self.view.frame.width / 4
    			let aView = UICollectionView(frame: CGRect(x: 0, y: 0, width: width, height: (emojibottom.frame.height)), collectionViewLayout: fl)
    			aView.delegate = self
    			aView.dataSource = self
    			aView.isScrollEnabled = false
    			aView.allowsMultipleSelection = false
    			aView.register(UINib.init(nibName: "ViewCell", bundle: nil), forCellWithReuseIdentifier: "myCell")
    			self.popover1.show(aView, fromView: button, inView: self.view)
    		} //end if button
    	} //end if state
    }
    
    //collection view
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    	let cell = collectionView.cellForItem(at: indexPath) as! CollectionViewCell
    	(textDocumentProxy as UIKeyInput).insertText(cell.tLabel.text!)
    	popover1.dismiss()
    }
    
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    	if extras.count > 0 {
    		return extras.count}
    	else {return 0 }
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    	let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "myCell", for: indexPath) as! CollectionViewCell
    	cell.tLabel.text = extras[indexPath.row]
    	return cell
    }
    
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize {
    	let width = collectionView.frame.width/(CGFloat(extras.count))
    	let height = collectionView.frame.height
    	return CGSize(width: width, height: height)
    }
         }
    

    `

    but whenever I select something from the popover, it does not dismiss.

    opened by BhaktiKarva 16
  • Not Working in iOS 11

    Not Working in iOS 11

    Popover works till iOS 10 but it doesn't pop up at all in iOS 11.

    opened by sudeep23 11
  • Build Error

    Build Error

    Helo, I just installed version 1.0.4 because I am using Swift 3.0 I tried to build the project but it gives me error in the Popover.swift file at - self.showAsDialog(contentView, inView: UIApplication.shared.keyWindow!) error - 'shared' is unavailable. Use view controller based solutions where appropriate instead.

    Please help.

    opened by BhaktiKarva 11
  • how to popover a tableView in a tableViewController

    how to popover a tableView in a tableViewController

    it is conflict when I implement the delegate method and datasource method.

    opened by ghost 10
  • can I popover a viewController?

    can I popover a viewController?

    many thanks

    opened by superlbr 8
  • fix corner arrow integration

    fix corner arrow integration

    fix corner arrow integration with popover corner radius. fix this : to this

    opened by gautierdelorme 5
  • Ignoring  bogus layer size

    Ignoring bogus layer size

    Great UI framework, thanks! I created a new class that launches a popover from a custom toolbar ( see RichEditorView framework), the popover has a UIToolbar as content view. Some bar button items in the RichEditorView Toolbar launch the popover, so I reuse the popover but change the items in the toolbar content view (see note taking apps like Evernote, same logic). When I tap the same item on the RichEditorToolbar a second time, the popover doesn't appear. it appears only the first time or if I tap another item...

    Console prints this warning:** [<CALayer: 0x7fda7b3160c0> display]: Ignoring bogus layer size (1390000.000000, 540000.000000), contentsScale 2.000000, backing store size (2780000.000000, 1080000.000000)**

    Does anyone experience the same problem? I can't exclude that it has to do with something else going on in my app / view controller... Any idea what the cause might be?

    As shown in the gif below, the popover actually shows the black layover view in the background but the popover itself does not appear...

    popover launching only on 2nd tap

    thanks for any hints in the right direction

    opened by DominikButz 5
  • Show content view as a dialog

    Show content view as a dialog

    Add methods to show contentView as a dialog in center of inView.

    opened by kientux 5
  • How to set options in Objective-C

    How to set options in Objective-C

    Im trying to use your library in an Objective-C project but i don't seem to find out how to set options to a popover object .. Could someone help me ? Thank you

    opened by rico237 5
  • Issue about swift3.0 from cocoapods

    Issue about swift3.0 from cocoapods

    Hello guy Firstly, This is an awesome library popover swift 💯 I see in requirement, it supports xCode 8+ and swift 3.0 but when I install from pods it has only version 0.9.1. So if i mistake anywhere, i need advice from you. thank

    opened by catmans1 4
  • transform change it's subview's frame

    transform change it's subview's frame

    Execuse me,

    I have set contentView.frame = CGRect(0, 10, 100, 100). But after a Popover transform in func show(), it's contentView has changed frame. Then I find:

    override open func layoutSubviews() {
       super.layoutSubviews()
       self.contentView.frame = self.bounds
     }
    

    scale tranform will execute this code, and contentView.frame will be changed.

    Thank you!

    opened by jiangliansong19 0
  • When tableView is larger than popoverView

    When tableView is larger than popoverView

    https://user-images.githubusercontent.com/29369132/112786462-7e0e1d80-9080-11eb-8b9e-ba53bf826266.mov

    cell.backgroundColor = .clear https://user-images.githubusercontent.com/29369132/112787129-10fb8780-9082-11eb-802f-8d14a4d16d91.mov

    how to fix the bottom inset of uitableview to fit popover?

    Thanks.

    opened by sseno 1
  • Add support for Swift Package Manager

    Add support for Swift Package Manager

    It will good if we add Swift Package Support. Thank you for your support!

    opened by Senocico 0
  • How do I change the starting show location?

    How do I change the starting show location?

    How do I fix Popover starting position by depending on the left or right, rather than from the center 如何让 Popover 起始位置固定是依赖左边或者是右边,而不是从中心位置显示

    opened by rgmyyw 2
  • 如果有阴影就好了

    如果有阴影就好了

    opened by chunxige 1
  • introduce border width

    introduce border width

    In order to fulfill a design i am planning i would need a border width option.

    opened by break2k 0
  • Popover with SearchBar doesn't track

    Popover with SearchBar doesn't track

    when Ii try to add SearchController inside Popover AnchorView, searchbar method searchBarTextDidBeginEditing doesn't call when searchbar textfield become edting.

    opened by Lihuo 0
  • Shadow in iOS 13 Dark Mode

    Shadow in iOS 13 Dark Mode

    Because the default background of UIView is black, which makes the shadow invisible.

    opened by sicaboy 1
Releases(1.2.2)
Owner
Yusuke Takahashi
Yusuke Takahashi
Subscription View Controller like the Tinder uses

SubscriptionPrompt SubscriptionPrompt is a UIViewController with a carousel at the top and a number of rows at the bottom. Written in Swift, works for

Binur Konarbai 238 Oct 24, 2021
LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.

LNPopupController LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and

Leo Natan 2.8k Nov 24, 2021
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Exyte 1.1k Nov 11, 2021
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

Introduction Popup Dialog is a simple, customizable popup dialog written in Swift. Features Easy to use API with hardly any boilerplate code Convenien

Orderella Ltd. 3.7k Nov 18, 2021
A lightweight library for popup view

SHPopup SHPop is lightweight library used for popup view Sample One Sample Two Sample Three Features SHPopup supports a popup inside another popup wit

Shezad Ahamed 36 Aug 11, 2021
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

SwiftEntryKit ?? Donations can be made here. Table of Contents Overview Features Example Project Example Project Installation Presets Playground Requi

Daniel Huri 5.7k Nov 20, 2021
Simple Swift class for iOS that shows nice popup windows with animation.

NMPopUpView Simple class for iOS that shows nice popup windows, written in Swift. The project is build with Swift 4.0, so you need Xcode 9.0 or higher

Nikos Maounis 197 Aug 8, 2020
Swift wrapper for custom ViewController presentations on iOS

Presentr is a simple customizable wrapper for the Custom View Controller Presentation API introduced in iOS 8. About iOS let's you modally present any

Icalia Labs 2.8k Nov 12, 2021
PopupWindow is a simple Popup using another UIWindow in Swift

PopupWindow PopupWindow is a simple Popup using another UIWindow Feature PopupWindow can be displayed at the top or bottom of the screen. Popup can se

shinji hayashi 405 Nov 26, 2021
:balloon: An Xcode plugin that makes working with color easier

XcodeColorSense An Xcode plugin that makes working with color easier. Inspired by ColorSense-for-Xcode with extra care for Hex color Features Show col

Khoa 78 Dec 29, 2020
An animated popover that pops out a given frame, great for subtle UI tips and onboarding.

Animated popover that pops out of a frame. You can specify the direction of the popover and the arrow that points to its origin. Color, border radius

Andrea Mazzini 2.8k Nov 26, 2021
IntervalSlider is a slider library like ReutersTV app. written in pure swift.

IntervalSlider Description and appetize.io`s DEMO To run the example project, clone the repo, and run pod install from the Example directory first. Re

Nobuyasu 65 May 22, 2021
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2

GLTableCollectionView Branch Status master develop What it is GLTableCollectionView is a ready to use UITableViewController with a UICollectionView fo

Giulio 714 Oct 28, 2021
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.

PullToDismiss PullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth

Suguru Kishimoto 472 Nov 19, 2021
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.

PullToDismiss PullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth

Suguru Kishimoto 472 Nov 19, 2021
📷 multiple phassets picker for iOS lib. like a facebook

Written in Swift 5.0 TLPhotoPicker enables application to pick images and videos from multiple smart album in iOS, similar to the current facebook app

junhyi park 1.8k Nov 20, 2021
Fully customizable Facebook reactions like control

Reactions is a fully customizable control to give people more ways to share their reaction in a quick and easy way. Requirements • Usage • Installatio

Yannick Loriot 578 Nov 15, 2021
The horizontal swiping navigation like on Facebook Messenger.

UIMenuScroll UIMenuScroll creating menu how on Facebook Messenger on take photo Installation CocoaPods is a dependency manager for Cocoa projects. You

Aleksey Pleshkov 17 Mar 8, 2021
An easy way to add mentions to uitextview like Facebook and Instagram

OEMentions An easy way to add mentions to uitextview like Facebook and Instagram. It also include a tableview to show the users list to choose from. T

Omar Alessa 42 May 24, 2021
Custom AVPlayerLayer on view and transition player with good effect like youtube and facebook

MMPlayerView Demo-Swift List / Shrink / Transition / Landscape MMPlayerLayer ex. use when change player view frequently like tableView / collectionVie

Millman Yang 711 Nov 6, 2021
A utility that reminds your iPhone app's users to review the app written in pure Swift.

SwiftRater SwiftRater is a class that you can drop into any iPhone app that will help remind your users to review your app on the App Store/in your ap

Takeshi Fujiki 246 Nov 15, 2021
Swipe to "like" or "dislike" any view, just like Tinder.app. Build a flashcard app, a photo viewer, and more, in minutes, not hours!

MDCSwipeToChoose Swipe to "like" or "dislike" any view, just like Tinder.app. Build a flashcard app, a photo viewer, and more, in minutes, not hours!

Brian Gesiak 2.6k Nov 11, 2021
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift

SKPhotoBrowser Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift features Display one or more images by providi

keishi suzuki 2.3k Nov 24, 2021
FacebookImagePicker is Facebook album photo picker written in Swift.

Features • Installation • Usage • Translation • License GBHFacebookImagePicker is Facebook's album photo picker written in Swift, built to provide a s

Florian Gabach 223 Sep 1, 2021
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift

SKPhotoBrowser Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift features Display one or more images by providi

keishi suzuki 2.3k Nov 24, 2021
Basic app to show how to login with Facebook, Google, Twitter. Created for learning purpose :) using Xcode 9 and Swift 4.0

Social Logins iOS Basic app to show how to login with Facebook, Google, Twitter. Created for learning purpose :) using Xcode 9 and Swift 4.0 Note: Bef

Jogendra 11 Nov 2, 2020
ListPlaceholder is a swift library allows you to easily add facebook style animated loading placeholder to your tableviews or collection views.

ListPlaceholder ListPlaceholder Facebook news feed style animation Features ListPlaceholder is a swift library allows you to easily add facebook style

Moayad Al Kouz 616 Nov 9, 2021
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

Yuji Hato 3.3k Nov 17, 2021