All Projects → shin8484 → Popupwindow

shin8484 / Popupwindow

Licence: mit
PopupWindow is a simple Popup using another UIWindow in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Popupwindow

BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (-92.02%)
Mutual labels:  popup-window, popup, toast
vercel-toast
💬 Framework-agnostic vercel design's toast component (≈1KB Gzipped)
Stars: ✭ 67 (-83.29%)
Mutual labels:  popup, toast
AckBar
AckBar is a very lightweight and customizable android library to display brief message to user.
Stars: ✭ 14 (-96.51%)
Mutual labels:  popup-window, toast
xxy
xxy xxy.js alert 移动端弹窗 弹窗 上拉加载 下拉刷新 移动端UI 轮播 banner
Stars: ✭ 84 (-79.05%)
Mutual labels:  popup-window, toast
Alerttoast
Create Apple-like alerts & toasts using SwiftUI
Stars: ✭ 151 (-62.34%)
Mutual labels:  toast, popup
Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (-54.61%)
Mutual labels:  toast, popup
ToolTipPopupWordTV
ToolTipopupWordTV is an Open Source Android library that allows developers to easily open a popup with details by select a word from a textview.
Stars: ✭ 41 (-89.78%)
Mutual labels:  popup-window, popup
Anylayer
Android稳定高效的浮层创建管理框架
Stars: ✭ 745 (+85.79%)
Mutual labels:  toast, popup
SimpleToast
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or MacOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals.
Stars: ✭ 131 (-67.33%)
Mutual labels:  popup, toast
neodigm55
An eclectic low-code vanilla JavaScript UX micro-library for those that defiantly think for themselves.
Stars: ✭ 14 (-96.51%)
Mutual labels:  popup, toast
Popbox.js
A tiny and simple stackable modal plugin for web apps
Stars: ✭ 295 (-26.43%)
Mutual labels:  popup, popup-window
Wpopup
一个简单使用并且高度定制的Popupwindow。超简单实现朋友圈点赞效果,并且只用一个WPopup!完全不用担心复用问题!点击切换动画效果等!
Stars: ✭ 269 (-32.92%)
Mutual labels:  popup, popup-window
Aiforms.dialogs
AiForms.Dialogs for Xamarin.Forms
Stars: ✭ 143 (-64.34%)
Mutual labels:  toast, popup
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+3373.57%)
Mutual labels:  toast, popup
Toastui
A simple way to show toast in SwiftUI.
Stars: ✭ 138 (-65.59%)
Mutual labels:  toast, popup
WechatPopupWindow
高仿微信聊天界面长按弹框样式
Stars: ✭ 71 (-82.29%)
Mutual labels:  popup-window, popup
Popupview
Toasts and popups library written with SwiftUI
Stars: ✭ 581 (+44.89%)
Mutual labels:  toast, popup
Sweet Alert
A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL
Stars: ✭ 696 (+73.57%)
Mutual labels:  toast, popup
MaterialDesign-Toast
Custom android Toast with Material Design
Stars: ✭ 70 (-82.54%)
Mutual labels:  popup, toast
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (-75.56%)
Mutual labels:  popup, toast

PopupWindow

Version License Carthage compatible Platform

image

PopupWindow is a simple Popup using another UIWindow

Feature

  • PopupWindow can be displayed at the top or bottom of the screen.
  • Popup can set margins, cornerRadius, blur, etc.
  • When displaying blur, you can't touch the below contents.
  • By erasing blur, you can touch the below contents.
  • Popup are displayed on another window, so you can leave Popup even when screen transitions.
TopToast BottomToast TopCard BottomCard Example
demo_01 demo_02 demo_03 demo_04 demo_05

Installation

CocoaPods

Add PopupWindow to your Podfile:

pod 'PopupWindow'

Carthage

Add PopupWindow to your Cartfile:

github "shin8484/PopupWindow"

Usage

When displaying popup in another window, please call first PopupWindowManager changeKeyWindow(rootViewController: UIViewController)

PopupWindowManager.shared.changeKeyWindow(rootViewController: UIViewController())

Create and show show

Create a PopupItem in the ViewController where you want to display the popup and call the method of BasePopupViewController

let popupOption = PopupOption(shapeType: .roundedCornerTop(cornerSize: 8), viewType: .toast, direction: .bottom)
let popupItem = PopupItem(view: loginView,
                          height: Const.firstViewFrame.height,
                          maxWidth: 500,
                          popupOption: popupOption)

First popup implementation is included in BasePopupViewController's loadView, viewDidAppear. If you want to create the next popup, please call showPopupView().

class SampleViewController: BasePopupViewController {
    override open func loadView() {
        super.loadView()
        setupPopupContainerView()
    }

    override open func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        makePopupView(with: item)
        showPopupView(duration: item.duration, curve: .easeInOut, delayFactor: 0.0)
    }
}

Transform & Replace

Replace the display contents, and perform deformation to the specified size. By using PopupItem, you can specify content contents and size.

transformPopupView(duration: Const.transformDuration, curve: .easeInOut, popupItem: popupItem) { [weak self] _ in
    guard let me = self else { return }
    me.replacePopupView(with: popupItem)
    me.dismissPopupView(duration: 3.3, curve: .easeInOut, delayFactor: 0.9, direction: .top) { _ in }
}

Dismiss

Specify hide animation direction with PopupViewDirection

dismissPopupView(duration: 3.3, curve: .easeInOut, delayFactor: 0.9, direction: .bottom) { _ in
    PopupWindowManager.shared.changeKeyWindow(rootViewController: nil)
}

PopupItem

PopupItem and PopupOption are struct to set up a popup, View, size, direction, whether it is rounded, margin, blurred or not, duration, maxWidth, type

public struct PopupItem {
    public let view: UIView
    public let height: CGFloat
    public let maxWidth: CGFloat
    public let landscapeSize: CGSize?
    public let popupOption: PopupOption
}
public struct PopupOption {
    public let shapeType: ShapeType
    public let viewType: ViewType
    public let direction: PopupViewDirection
    public let margin: CGFloat
    public let hasBlur: Bool
    public let duration: TimeInterval
    public let canTapDismiss: Bool
}

Landscape

maxWidth

By setting maxWidth with popupitem's initializer, you can set the maximum width of the popup in landscape mode.

image

landscapeSize

You can set popup size at landscape. The size changes only when landscape size is set, and the default is nil. Using landscapeSize and SizeClass, you can customize PopupVIew that has the widest width like GIF below when rotating.

demo_06

Requirements

  • iOS 10.0+
  • Xcode 9.1+
  • Swift 3.0.1+

LICENSE

Under the MIT license. See LICENSE file for details.

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].