Code Monkey home page Code Monkey logo

photopicker's Introduction

PhotoPicker

高仿iOS微信图片选择器swift版,基于Photokit(photo picker like WeChat by PhotoKit)

支持版本

iOS8.0+
Swift3.0 (current master branch)

使用说明

当前master分支为Swift3.0版本分支,如果想使用Swift 2.0+系列,请切换到Swfit2分支,在需要使用的地方,直接调用以下代码即可:

let picker = PhotoPickerController(type: PageType.RecentAlbum)
picker.imageSelectDelegate = self
picker.modalPresentationStyle = .Popover
        
// max select number
PhotoPickerController.imageMaxSelectedNum = 4
        
self.showViewController(picker, sender: nil)

图片选择器默认打开最近添加相册列表,如果需要打开其他相册,或者首先打开相册列表,请直接设置PageType枚举具体类型即可:

enum PageType{
    case List      // 打开相册列表
    case RecentAlbum // 直接打开最近添加相册
    case AllAlbum // 直接打开所有相册列表
}

更多参数配置选项,请参照PhotoPickerConfig.swift配置文件。

注意

  1. 当前版本不支持视频,如有需求请反馈
  2. 调用相册和拍照需要在info.plist文件中添加如下两个key, 否则程序会崩溃:
Privacy - Photo Library Usage Description
Privacy - Camera Usage Description

photopicker's People

Contributors

apptut avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.