A Swift Popup Module help you popup your custom view easily

Related tags

Popup JFPopup
Overview

JFPopup

CI Status Version License Platform

JFPopup is a Swift Module help you popup your custom view easily.

Support 3 way to popup, Drawer, Dialog and BottomSheet.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Quick Create your popup view

Dialog

对话框模式,类似UIAlertConroller, 你也可以编写你的自定义AlertView

self.popup.dialog {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
            v.backgroundColor = .red
            return v
        }

Drawer

抽屉模式,支持左右抽屉,宽度自定义,最大可以全屏,

//default left
self.popup.drawer {
            let v = DrawerView(frame: CGRect(x: 0, y: 0, width: CGSize.jf.screenWidth(), height: CGSize.jf.screenHeight()))
            v.closeHandle = { [weak self] in
                self?.popup.dismiss()
            }
            return v
        }

self.popup.drawer(with: .right) {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: CGSize.jf.screenHeight()))
            v.backgroundColor = .red
            return v
        }

Bottomsheet

类似Flutter Bottomsheet, 底部往上弹出一个容器。 你也可以给予此创建你的个人自定义风格UIActionSheet. 底下有微信风格的组件已封装

self.popup.bottomSheet {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: CGSize.jf.screenWidth(), height: 300))
            v.backgroundColor = .red
            return v
        }

通用组件

v1.0,暂时只有一款微信风格ActionSheet, 基于上面bottomSheet打造,后续会基于上面基础popup,打造更多基础组件

self.popup.actionSheet {
            [
                JFPopupAction(with: "拍摄", subTitle: "照片或视频照片", clickActionCallBack: { [weak self] in
                    self?.pushVC()
                }),
                JFPopupAction(with: "从手机相册选择", subTitle: nil, clickActionCallBack: {

                }),
                JFPopupAction(with: "用秒剪制作视频", subTitle: nil, clickActionCallBack: {

                }),
            ]
        }

VC模式创建

此方法推荐兼容OC情况下使用,或者你的popup View代码量非常大 需要一个vc来管理。

继承写法 (类似继承UITableView,dataSoure写在内部)

var config = JFPopupConfig.bottomSheet
        config.isDismissible = false
        let vc = TestCustomViewController(with: config)
        vc.show(with: self)

闭包写法

var config = JFPopupConfig.dialog
        config.bgColor = .clear
        let vc = JFPopupController(with: config, popupProtocol: self) {
            let view: UIView = {
                let view = UIView()
                view.frame = CGRect(x: 0, y: 0, width: 200, height: 200)
                view.layer.cornerRadius = 12
                view.backgroundColor = .black
                return view
            }()
            return view
        }
        vc.show(with: self)

Requirements

Installation

JFPopup is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'JFPopup', '1.0.0'

Author

JerryFans, [email protected]

License

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

You might also like...
The library allows to create simple popup menus

react-native-popup-menu This library allows to create simple popup menus Installation "react-native-popup-menu": "sergeymild/react-native-popup-menu"

WKWebView handling popup windows

WKWebViewWithPopUp WKWebView handling pop-up windows Property If there is a pop-up window, use the pop-up window. If there is no pop-up window, use th

Pop-up based view(e.g. alert sheet), can be easily customized.
Pop-up based view(e.g. alert sheet), can be easily customized.

MMPopupView 中文介绍 A basic Pop-Up Kit allows you to easily create Pop-Up view. You can focus on the only view you want to show. Besides, it comes with 2

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
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

LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
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

Swift wrapper for custom ViewController presentations on iOS
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

MIBlurPopup lets you create popups with a blurred background
MIBlurPopup lets you create popups with a blurred background

MIBlurPopup MIBlurPopup lets you create amazing popups with a blurred background Setup Add pod 'MIBlurPopup' to your Podfile or copy the "MIBlurPopup.

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

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

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

Comments
  • 奇怪,真机无法弹出

    奇怪,真机无法弹出

        JFPopupView.popup.actionSheet { [self] in
            [
                JFPopupAction(with: "xxx", subTitle: nil, clickActionCallBack: {
                }),
    
                JFPopupAction(with: "xxx", subTitle: nil, clickActionCallBack: {
                }),
            ]
        }
    

    用了上面的代码,在模拟器上完全正常,但在真机上无法弹出,请问会是什么问题呢?

    opened by bxcx 3
Releases(1.5.0)
Owner
逸风
A iOS Developer.
逸风
⛩ Presenting custom views as a popup in iOS.

FFPopup is a lightweight library for presenting custom views as a popup. Bounce from Top & Bounce to Bottom Bounce from Top & Bounce to Top Bounce in

JonyFang 828 Jan 5, 2023
IAMPopup is a simple class for expressing custom popup in various forms.

IAMPopup Introduction IAMPopup is a simple class for expressing custom popup in various forms. This includes where to display the popup and space to d

Hosung Kang 18 Dec 29, 2022
Simple way to present custom views as a popup in iOS and tvOS.

PopupKit PopupKit is a simple and flexible iOS framework for presenting any custom view as a popup. It includes a variety of options for controlling h

Pointwelve 59 Mar 1, 2022
PopupController is a controller for showing temporary popup view.

PopupController PopupController is a controller for showing temporary popup view. Demo Try PopupController on Appetize.io Installation CocoaPods pod '

daisuke sato 338 Dec 14, 2022
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 37 Oct 2, 2022
A framework for presenting bars and view controllers as popup, much like the look and feel of Apple Music App.

PBPopupController PBPopupController is a framework for presenting bars and view controllers as popup, much like the look and feel of Apple Music App.

Patrick 58 Dec 3, 2022
STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.

STPopup STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Obj

Kevin Lin 2.6k Jan 6, 2023
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 194 Jun 5, 2022
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.8k Dec 20, 2022
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 415 Dec 5, 2022