GithubHelp home page GithubHelp logo

mdeora / abra Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opensooq/abra

0.0 1.0 0.0 8.75 MB

Your next favorite image and video picker from Gallery for Swift

License: Other

Swift 99.09% Ruby 0.91%

abra's Introduction

Gallery Banner

AbraGallery is a small library for images & videos picking. It provides video recording too.

Usage

GalleryController is the main entry point, just instantiate and set the delegate:

let gallery = GalleryController()
gallery.delegate2 = self
present(gallery, animated: true, completion: nil)

Delegate

The GalleryControllerDelegate2 requires you to implement some delegate methods in order to interact with the GalleryController

public protocol GalleryControllerDelegate2: class {
  func galleryController(_ controller: GalleryController, requestLightbox images: [UIImage])
  func galleryControllerDidCancel(_ controller: GalleryController)
  func galleryController(_ controller: GalleryController, didSelectAssets assets: [PHAsset])
}

Permission

Gallery handles permissions for you. It checks and askes for photo and camera usage permissions at first launch. As of iOS 10, we need to explicitly declare usage descriptions in plist files

<key>NSCameraUsageDescription</key>
<string>This app requires access to camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to photo library</string>

You may disable permissions flow by the config Gallery.Config.Permission.shouldCheckPermission = false

Configuration

There are lots of customization points in Config structs. For example

Config.Permission.image = UIImage(named: ImageList.Gallery.cameraIcon)
Config.Font.Text.bold = UIFont(name: FontList.OpenSans.bold, size: 14)!
Config.Camera.recordLocation = true
Config.Camera.recordMode = .video                  // to enable video recording.
Config.VideoRecording.maxBytesCount = 1024         // to set the maximum size of video.
Config.VideoRecording.maxLengthInSeconds = .video  // to set the max length of video.
Config.Selection.mode = [.photo, .camera, .video]  // to enable/disable Photo, Camera and Video tabs.
Config.SessionPreset.quality = AVCaptureSessionPresetHigh // to define the quality of recorded video.

... and many many more at Config file.

Installation

AbraGallery is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'AbraGallery'

AbraGallery can also be installed manually. Just download and drop Sources folders in your project.

Author & Contact

OpenSooq, [email protected], [email protected]

Abra Gallery is build at the top of Gallery project.

Contributing

We would love you to contribute to AbraGallery, check the CONTRIBUTING file for more info.

License

AbraGallery is available under the MIT license. See the LICENSE file for more info.

abra's People

Contributors

damian-kolakowski avatar hyperseed avatar konradrodzik avatar onmyway133 avatar vadymmarkov avatar

Watchers

 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.