All Projects → pujiaxin33 → Jxpopupview

pujiaxin33 / Jxpopupview

Licence: mit
一个轻量级的自定义视图弹出框架

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Jxpopupview

SPStorkController
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,515 (+2049.57%)
Mutual labels:  alert, popover, popup, pop
Spstorkcontroller
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,494 (+2031.62%)
Mutual labels:  pop, alert, popup, popover
mac-ibm-notifications
macOS agent used to display custom notifications and alerts to the end user.
Stars: ✭ 206 (+76.07%)
Mutual labels:  alert, dialog, popup
PopOverAlert
PopOverAlert is a PopOver style alert view.
Stars: ✭ 56 (-52.14%)
Mutual labels:  alert, popover, pop
React Native Alert Pro
The Pro Version of React Native Alert (Android & iOS)
Stars: ✭ 69 (-41.03%)
Mutual labels:  dialog, alert, popup
Jh flutter demo
a flutter demo
Stars: ✭ 229 (+95.73%)
Mutual labels:  pop, dialog, alert
eins-modal
Simple to use modal / alert / dialog / popup. Created with pure JS. No javascript knowledge required! Works on every browser and device! IE9
Stars: ✭ 30 (-74.36%)
Mutual labels:  alert, dialog, popup
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 (-72.65%)
Mutual labels:  alert, dialog, popup
Pmalertcontroller
PMAlertController is a great and customizable alert that can substitute UIAlertController
Stars: ✭ 2,397 (+1948.72%)
Mutual labels:  dialog, alert, popup
Alertjs
Dialog Builder allows you to create fully customisable dialogs and popups in Dynamics 365.
Stars: ✭ 80 (-31.62%)
Mutual labels:  dialog, alert, popup
Popupdialog
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Stars: ✭ 3,709 (+3070.09%)
Mutual labels:  dialog, alert, popup
React Native Awesome Alerts
Awesome alerts for React Native, works with iOS and Android.
Stars: ✭ 391 (+234.19%)
Mutual labels:  dialog, alert, popup
Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (+55.56%)
Mutual labels:  pop, alert, popup
react-redux-modal-flex
[DEPRECATED] Make easy a modal/popup with Redux
Stars: ✭ 14 (-88.03%)
Mutual labels:  alert, dialog, popup
Nativepopup
Clone of Apple iOS App's feedback popup, and easily customizable.
Stars: ✭ 247 (+111.11%)
Mutual labels:  dialog, alert, popup
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (-14.53%)
Mutual labels:  dialog, alert, popup
Alerttoast
Create Apple-like alerts & toasts using SwiftUI
Stars: ✭ 151 (+29.06%)
Mutual labels:  dialog, alert, popup
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+11805.13%)
Mutual labels:  dialog, alert, popup
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (-16.24%)
Mutual labels:  alert, dialog, popup
Sweetalert
A beautiful replacement for JavaScript's "alert"
Stars: ✭ 21,871 (+18593.16%)
Mutual labels:  dialog, alert, popup

JXPopupView

一个轻量级的自定义视图弹出框架,可灵活配置动画、背景风格。

特性

  • 默认提供丰富的动画效果,而且可以灵活的扩展配置,只要遵从并实现PopupViewAnimator协议即可;
  • 使用范围更广,通过view封装,可以在任何view上面展示,并不局限于UIViewController;
  • 弹框背景配置灵活,借鉴了MBProgressHUD对背景视图的处理逻辑;
  • 交互细节可配置,提供了isDismissibleisInteractiveisPenetrable属性进行配置;

预览

动画效果

动画效果 GIF
渐隐渐现 GIF
缩放 GIF
往左 GIF
往右 GIF
往下 GIF
往上 GIF
弹性动画 GIF
完全自定义动画 GIF

Layout布局方式

动画效果 GIF
Top顶部 GIF
Bottom底部 GIF
Leading前部 GIF
Trailing尾部 GIF
Center 居中(无示意图)
Frame 自定义frame(无示意图)

背景风格

背景风格 GIF
固定色值 GIF
blur light GIF
blur dark GIF

指定containerView

指定containerView GIF
Window GIF
UIViewController.view GIF
CustomView GIF

要求

iOS: 9+ XCode: 12.1+ swift: 5.0+

安装

CocoaPods

在Podfile文件里面添加

pod 'JXPopupView'

然后再pod install(最好先pod update)

使用

//- 确定contentView的布局方式
enum Layout {
    case center(Center)
    case top(Top)
    case bottom(Bottom)
    case leading(Leading)
    case trailing(Trailing)
    case frame(CGRect)
}
//如果contentView重载了intrinsicContentSize属性并返回其内容的CGSize,就无需再设置width、height值。
let layout: BaseAnimator.Layout = .center(.init(offsetY: 0, offsetX: 0, width: 200, height: 200))
//- 确定动画效果
let animator = FadeInOutAnimator(layout: layout)
//- 初始化JXPopupView
let contentView = TestAlertView()
let popupView = JXPopupView(containerView: containerView, contentView: contentView, animator: animator)
//- 配置交互
popupView.isDismissible = true
popupView.isInteractive = true
popupView.isPenetrable = false
//- 配置背景
popupView.backgroundView.style = self.backgroundStyle
popupView.backgroundView.blurEffectStyle = self.backgroundEffectStyle
popupView.backgroundView.color = self.backgroundColor
//- 展示popupView
popupView.display(animated: true, completion: nil)
//- 消失popupView
//通过extension提供的popupView方法,获取JXPopupView进行操作,可以不用全局持有JXPopupView属性
contentView.popupView()?.dismiss(animated: true, completion: nil)

动画自定义

PopupViewAnimator协议方法

    /// 初始化配置动画驱动器
    ///
    /// - Parameters:
    ///   - popupView: PopupView
    ///   - contentView: 自定义的弹框视图
    ///   - backgroundView: 背景视图
    /// - Returns: void
    func setup(popupView: PopupView, contentView: UIView, backgroundView: PopupView.BackgroundView)containerView: UIView)

    /// 处理展示动画
    ///
    /// - Parameters:
    ///   - contentView: 自定义的弹框视图
    ///   - backgroundView: 背景视图
    ///   - animated: 是否需要动画
    ///   - completion: 动画完成后的回调
    /// - Returns: void
    func display(contentView: UIView, backgroundView: JXBackgroundView, animated: Bool, completion: @escaping ()->())

    /// 处理消失动画
    ///
    /// - Parameters:
    ///   - contentView: 自定义的弹框视图
    ///   - backgroundView: 背景视图
    ///   - animated: 是否需要动画
    ///   - completion: 动画完成后的回调
    func dismiss(contentView: UIView, backgroundView: JXBackgroundView,animated: Bool, completion: @escaping ()->())

自定义动画建议

  • 完全自定义动画 可以继承BaseAnimator或者自己新建一个类,遵从PopupViewAnimator协议,实现对应方法即可。参考demo工程的BaseAnimator

证书

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

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