Giter Site home page Giter Site logo

ancainu / srcameraview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sridenour/srcameraview

0.0 2.0 1.0 223 KB

Simple class for taking pictures in iOS apps without having to use UIImagePickerController.

License: MIT License

Objective-C 100.00%

srcameraview's Introduction

SRCameraView

Written for the iOS 8.0 SDK, but supports deployment to iOS 7.1. There is no explicit support for iOS 6 or earlier, but it may work.

How To Install

  1. Create an iOS project in Xcode.
  2. Add the following frameworks:
  • CoreGraphics (if it isn't already)
  • AVFoundation
  • CoreVideo
  • CoreMedia
  1. Add all the files in the source/ directory to your project. Put the headers (.h) and Objective-C source (.m) in whatever group you want. Put the images (.png) in the Supporting Files group.

How to Use

  1. Import SRCameraView.h in the source for whatever view controller will be managing the camera view.
  2. Detect for the presence of a camera (if you haven't already).
  3. Create an instance of SRCameraView using -initWithFrame:
  4. Set the resizing mask and whatever other properties you want (background color, etc.).
  5. Add your SRCameraView instance to your view controller's view.
  6. Call -start to begin the live preview.
  7. Call -takePhotoWithCompletionBlock: when you want to take a picture. The live preview will be paused, a photo will be taken, and your provided completion block will be called on the main thread.
  8. Set the paused property to NO after taking a picture when you're ready to un-pause the live preview.
  9. Call -stop when you're ready to get rid of the SRCameraView (such as in your view controller's viewDidUnload method).

See the CameraTest example app.

Licensed under MIT license.

srcameraview's People

Contributors

ancainu avatar sridenour avatar

Watchers

 avatar  avatar

Forkers

anish-kumar-dev

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.