PinpView 库是一个自定义 Swift 类,允许您创建类似于 WhatsApp 画中画 (PiP) 功能的浮动视图。 使用此库,您可以轻松地将具有各种交互元素的浮动视图添加到您的 iOS 应用程序中。
PinpView
类。let childView = UIView() // Create your custom child view
let pulloutIcon = UIImage(named: "pulloutIcon") // Provide the pullout button icon image
let pinpView = PinpView(frame: CGRect(x: 0, y: 0, width: 200, height: 200), indicatorColor: .gray, childView: childView, pulloutIcon: pulloutIcon)
superview.addSubview(pinpView)
您可以使用 Swift Package Manager 将 PinpView 库集成到您的项目中。 只需将以下依赖项添加到您的 Package.swift 文件中
dependencies: [
.package(url: "https://github.com/micomiloloza/PinpView.git", from: "1.0.0")
]
欢迎贡献! 如果您有任何想法、建议或错误报告,请提出 issue 或提交 pull request。
本项目根据 MIT 许可证获得许可。