Pellicola 1.0.1

Pellicola 1.0.1

Subito iOS DevsTomas Camin 维护。



Pellicola 1.0.1

  • Subito

Version License Platform

使用 Swift 编写的,支持多选的 UIImagePickerController 的替代品。

特性
替换 UIImagePickerController 并添加 多选 支持
👨🏻‍💻 使用 Swift 编写,具有完全的 Objective-C 兼容性
☁️ 支持 iCloud 照片库
🎨 自定义您应用程序的 UI
🌍 支持字符串本地化

我们在 Subito 应用中使用开源版本的 master 分支,链接:[Subito](https://itunes.apple.com/us/app/subito-it/id450775137?ls=1&mt=8)。


要求

  • Xcode 10.0+
  • iOS 9.0+
  • Swift 4.2+
  • 与 Objective-C 的互操作性

安装

Pellicola 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中

pod 'Pellicola'

示例

要运行示例项目,先克隆仓库,然后从示例目录中先运行 pod install

入门

使用样式创建一个 PellicolaPresenter 对象。我们提供了一个 DefaultPellicolaStyle 对象,该对象为 Pellicola 使用默认样式。didSelectImages 密闭体提供一个按用户选择顺序排列的选择图片数组。userDidCancel 密闭体让您知道用户是否从流程中退出。

使用 present(on: UIViewController, maxNumberOfSelections: Int) 方法显示 Pellicolosa 并指定可选择的图片的最大数量。

userDidCancel 密闭体以获取

import UIKit
import Pellicola

class ViewController: UIViewController {
    
    var pellicolaPresenter: PellicolaPresenter!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        pellicolaPresenter = PellicolaPresenter(style: DefaultPellicolaStyle())
        
        pellicolaPresenter.didSelectImages = { images in
            print("User selected \(images.count) images")
        }
        
        pellicolaPresenter.userDidCancel = {
            print("User did cancel the flow")
        }
        
        pellicolaPresenter.present(on: self, maxNumberOfSelections: 10)
    }
}

作者

贡献

欢迎您提出想法、问题或拉取请求进行协作。

附言:如果您在您的应用程序中使用 Pellicola,我们很乐意听到您的反馈!

许可

Pellicola 在 Apache License, Version 2.0 许可下可用。更多信息请参阅 LICENSE 文件