{"id":18974661,"url":"https://github.com/pujiaxin33/jxpopupview","last_synced_at":"2025-05-09T00:02:39.104Z","repository":{"id":56916741,"uuid":"154123852","full_name":"pujiaxin33/JXPopupView","owner":"pujiaxin33","description":"一个轻量级的自定义视图弹出框架","archived":false,"fork":false,"pushed_at":"2024-07-08T07:37:03.000Z","size":942,"stargazers_count":153,"open_issues_count":0,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-09T00:01:55.939Z","etag":null,"topics":["alert","dialog","display","pop","popover","popup"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pujiaxin33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T10:17:03.000Z","updated_at":"2025-04-04T14:14:56.000Z","dependencies_parsed_at":"2025-01-17T12:13:19.471Z","dependency_job_id":"cac78b2b-f058-4858-9f82-7e9ac4dcf63e","html_url":"https://github.com/pujiaxin33/JXPopupView","commit_stats":{"total_commits":45,"total_committers":2,"mean_commits":22.5,"dds":0.3555555555555555,"last_synced_commit":"dc359f11d4df656d177df9a977236060e90443e2"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXPopupView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXPopupView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXPopupView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXPopupView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pujiaxin33","download_url":"https://codeload.github.com/pujiaxin33/JXPopupView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166502,"owners_count":21864475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alert","dialog","display","pop","popover","popup"],"created_at":"2024-11-08T15:15:43.601Z","updated_at":"2025-05-09T00:02:37.936Z","avatar_url":"https://github.com/pujiaxin33.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JXPopupView\n一个轻量级的自定义视图弹出框架，可灵活配置动画、背景风格。\n\n# 特性\n\n- 默认提供丰富的动画效果，而且可以灵活的扩展配置，只要遵从并实现`PopupViewAnimator`协议即可；\n- 使用范围更广，通过view封装，可以在任何view上面展示，并不局限于UIViewController；\n- 弹框背景配置灵活，借鉴了`MBProgressHUD`对背景视图的处理逻辑；\n- 交互细节可配置，提供了`isDismissible`、`isInteractive`、`isPenetrable`属性进行配置；\n\n# 预览\n\n## 动画效果\n\n动画效果 |  GIF\n----------|--------------\n| 渐隐渐现  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/FadeInOut.gif) |\n| 缩放  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/ZoomInOut.gif) |\n| 往左  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/Leftward.gif) |\n| 往右  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/Rightward.gif) |\n| 往下  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/Downward.gif) |\n| 往上  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/Upward.gif) |\n| 弹性动画  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/Spring.gif) |\n| 完全自定义动画  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/CustomAnimation.gif) |\n\n## Layout布局方式\n\n动画效果 |  GIF\n----------|--------------\n| Top顶部  | ![GIF](https://github.com/pujiaxin33/JXExampleImages/blob/master/PopupView/TopLayout.gif) |\n| Bottom底部  | ![GIF](https://github.com/pujiaxin33/JXExampleImages/blob/master/PopupView/BottomLayout.gif) |\n| Leading前部  | ![GIF](https://github.com/pujiaxin33/JXExampleImages/blob/master/PopupView/LeadingLayout.gif) |\n| Trailing尾部  | ![GIF](https://github.com/pujiaxin33/JXExampleImages/blob/master/PopupView/TrailingLayout.gif) |\n| Center  | 居中（无示意图） |\n| Frame  | 自定义frame（无示意图） |\n\n\n## 背景风格\n\n背景风格 |  GIF\n----------|--------------\n| 固定色值  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/FadeInOut.gif) |\n| blur light  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/Blurlight.gif) |\n| blur dark  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/BlurDark.gif) |\n\n## 指定containerView\n\n指定containerView |  GIF\n----------|--------------\n| Window  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/ZoomInOut.gif) |\n| UIViewController.view  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/VCView.gif) |\n| CustomView  | ![GIF](https://github.com/pujiaxin33/JXPopupView/blob/master/JXPopupView/GIF/CustomView.gif) |\n\n# 要求\n\niOS: 9+\nXCode: 12.1+\nswift: 5.0+\n\n# 安装\n\n## CocoaPods\n\n在Podfile文件里面添加\n```\npod 'JXPopupView'\n```\n然后再pod install（最好先pod update）\n\n# 使用\n\n```\n//- 确定contentView的布局方式\nenum Layout {\n    case center(Center)\n    case top(Top)\n    case bottom(Bottom)\n    case leading(Leading)\n    case trailing(Trailing)\n    case frame(CGRect)\n}\n//如果contentView重载了intrinsicContentSize属性并返回其内容的CGSize，就无需再设置width、height值。\nlet layout: BaseAnimator.Layout = .center(.init(offsetY: 0, offsetX: 0, width: 200, height: 200))\n//- 确定动画效果\nlet animator = FadeInOutAnimator(layout: layout)\n//- 初始化JXPopupView\nlet contentView = TestAlertView()\nlet popupView = JXPopupView(containerView: containerView, contentView: contentView, animator: animator)\n//- 配置交互\npopupView.isDismissible = true\npopupView.isInteractive = true\npopupView.isPenetrable = false\n//- 配置背景\npopupView.backgroundView.style = self.backgroundStyle\npopupView.backgroundView.blurEffectStyle = self.backgroundEffectStyle\npopupView.backgroundView.color = self.backgroundColor\n//- 展示popupView\npopupView.display(animated: true, completion: nil)\n//- 消失popupView\n//通过extension提供的popupView方法，获取JXPopupView进行操作，可以不用全局持有JXPopupView属性\ncontentView.popupView()?.dismiss(animated: true, completion: nil)\n```\n\n# 动画自定义\n\n## `PopupViewAnimator`协议方法\n\n```\n    /// 初始化配置动画驱动器\n    ///\n    /// - Parameters:\n    ///   - popupView: PopupView\n    ///   - contentView: 自定义的弹框视图\n    ///   - backgroundView: 背景视图\n    /// - Returns: void\n    func setup(popupView: PopupView, contentView: UIView, backgroundView: PopupView.BackgroundView)containerView: UIView)\n\n    /// 处理展示动画\n    ///\n    /// - Parameters:\n    ///   - contentView: 自定义的弹框视图\n    ///   - backgroundView: 背景视图\n    ///   - animated: 是否需要动画\n    ///   - completion: 动画完成后的回调\n    /// - Returns: void\n    func display(contentView: UIView, backgroundView: JXBackgroundView, animated: Bool, completion: @escaping ()-\u003e())\n\n    /// 处理消失动画\n    ///\n    /// - Parameters:\n    ///   - contentView: 自定义的弹框视图\n    ///   - backgroundView: 背景视图\n    ///   - animated: 是否需要动画\n    ///   - completion: 动画完成后的回调\n    func dismiss(contentView: UIView, backgroundView: JXBackgroundView,animated: Bool, completion: @escaping ()-\u003e())\n```\n\n## 自定义动画建议\n\n- 完全自定义动画\n可以继承`BaseAnimator`或者自己新建一个类，遵从`PopupViewAnimator`协议，实现对应方法即可。参考demo工程的`BaseAnimator`类\n\n# 证书\n\nJXPopupView is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpujiaxin33%2Fjxpopupview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpujiaxin33%2Fjxpopupview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpujiaxin33%2Fjxpopupview/lists"}