Git Product home page Git Product logo

hybridcamera's Introduction

version badge Lang platform SPM compatible SwiftLint Sindre codebeat badge Reviewed by Hound

img

Features:

Description
Records video ๐ŸŽฅ
takes photos ๐Ÿ“ท
Flash on/off โšก
Front / Back camera โ†•๏ธ
Hold to record video โœŠ
Tap to take photo ๐Ÿ‘‡
Tap to focus / set exposure ๐Ÿ”Ž
Pinch to zoom ๐Ÿ‘Œ
Looping video/photo preview ๐Ÿ”
Share button ๐Ÿ”—
Programatic UI ๐Ÿค–
Doesn't stop Spotify ๐ŸŽถ
Stores files in temporary ๐Ÿ’พ
Throw oriented code ๐Ÿ’ฃ
Persistent app authorisation ๐Ÿšซ
Animated record button ๐Ÿ”ด
Callback based ๐Ÿ“ž

Why use this camera framework

  • High codebeat GPA
  • Low class scoped variable count (In order to better handle overall state)
  • Setup errors can be handled from the POV of the initiator
  • Operation errors is handled in the onCapture completion block
  • Callback based (as oppose to delegate based) More info
  • Easily styleable (The camera view is separate from the UI view)
  • No third-party libraries or Sugar
  • Entirely programatic (No storyboard)
  • Thoroughly documented (Artifacts and sideEffects etc)
  • Uses Sindre-lint style guide
  • Small footprint, only ~750 LOC (Lines of code)

Notes:

  • In order to keep things simple, The UI is CGRect based. Use your own Autolayout distro like SnapKit etc when adding additional UI

Install:

  • SPM: .package(url: "https://github.com/eonist/HybridCamera.git", .branch("master"))
  • Manual: Open HybridCamera.xcodeproj

IMPORTANT: Make sure info.plist has these variables

Privacy - Microphone Usage Description   
Privacy - Camera Usage Description  
Privacy - Photo Library Additions Usage Description  

Example:

img

Example code:

self.view = HybridCamView()
view.camView.onPhotoCaptureComplete = { (image: UIImage?, url: URL?, error: Error?) in
   Swift.print("On photo capture complete \(url)")
}
hybridCamView.camView.onVideoCaptureComplete = { (url: URL?, error: Error?) in
   Swift.print("On Video capture complete \(url)")
}

Todo:

  • Add support for more orientation modes (Currently only supports portrait)
  • Add support for error resolution from the POV of initiating the camera
  • Make UI with AutoLayout ๐Ÿ‘ˆ
  • Make lib carthage support โœ…
  • Fix AudioBug โœ…
  • Fix FontCamera bug w/ IphoneX โœ…
  • Add Spatial, Chaplin as an option to HybridCam ๐Ÿ‘ˆ
  • Add CI-Travis ๐Ÿ‘ˆ

Contributors:

hybridcamera's People

Contributors

eonist 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.