Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPopup

轻量级 iOS 弹窗框架,基于 UIKit,无第三方依赖。

核心功能

  • 弹窗展示:支持居中、顶部、底部、左右等位置,可配置遮罩(纯色 / 模糊 / 无)
  • 动画:内置淡入淡出、缩放、滑动,支持自定义 EPopupAnimatable
  • 键盘避让:遵循 EPopupKeyboardResponsive 即可自动跟随键盘
  • 弹窗链EPopupChainDispatcher 支持单次或顺序弹出多个弹窗

系统要求

项目 版本
iOS 14.0+
Swift 5.9+,兼容Swift6

SPM 集成

Xcode

  1. File → Add Package Dependencies...
  2. 输入仓库地址,选择版本后添加
  3. 在 Target 的 Frameworks, Libraries, and Embedded Content 中勾选 EPopup

Package.swift

dependencies: [
    .package(url: "https://github.com/smelloftime/EPopup.git", from: "1.0.0")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: ["EPopup"]
    )
]

快速上手

import EPopup

// 1. 弹窗视图遵循 EPopupPresentable
class MyPopupView: UIView, EPopupPresentable {
    func preferredPopupSize(in container: UIView) -> CGSize {
        CGSize(width: 300, height: 200)
    }
}

// 2. 展示
var config = EPopupConfiguration()
config.placement = .center
config.animationType = .scale()

EPopupPresenter.show(MyPopupView(), in: view, config: config)

// 3. 关闭
EPopupPresenter.dismiss(popupView)

更多示例见 Example

About

EPopup 是一个用 Swift 编写的、轻量且高度可定制的 iOS 弹窗管理库。它专注于帮助开发者以最少的代码,优雅地实现各种自定义弹窗、抽屉面板或提示框。

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages