All Projects → tdginternet → Tgcameraviewcontroller

tdginternet / Tgcameraviewcontroller

Licence: mit
Custom camera with AVFoundation. Beautiful, light and easy to integrate with iOS projects.

Programming Languages

objective c
16641 projects - #2 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Tgcameraviewcontroller

passion
An object-oriented LÖVE game engine
Stars: ✭ 35 (-97.56%)
Mutual labels:  deprecated, unmaintained
Deprecated Mapbox Ios Sdk
REPLACED – use https://www.mapbox.com/ios-sdk instead
Stars: ✭ 325 (-77.3%)
Mutual labels:  deprecated, unmaintained
cleverbot
Deprecated/unmaintained. See https://www.cleverbot.com/api/
Stars: ✭ 23 (-98.39%)
Mutual labels:  deprecated, unmaintained
jade-babel
Jade plugin for Babel
Stars: ✭ 39 (-97.28%)
Mutual labels:  deprecated, unmaintained
Miniproxy
🚨⚠️ UNMAINTAINED! ⚠️🚨 A simple PHP web proxy.
Stars: ✭ 810 (-43.44%)
Mutual labels:  deprecated, unmaintained
django-snow
ServiceNow Ticket Management App for Django based projects
Stars: ✭ 16 (-98.88%)
Mutual labels:  deprecated, unmaintained
addon-sdk-content-scripts
DEPRECATED | Use WebExtensions instead | Add-ons demonstrating how to use content scripts in the Add-on SDK.
Stars: ✭ 23 (-98.39%)
Mutual labels:  deprecated, unmaintained
Cudlr
⛔️ [DEPRECATED] Console for Unity Debugging and Logging Remotely
Stars: ✭ 167 (-88.34%)
Mutual labels:  deprecated, unmaintained
Axe Cli
[Deprecated] A command-line interface for the aXe accessibility testing engine
Stars: ✭ 419 (-70.74%)
Mutual labels:  deprecated, unmaintained
Msx
JSX for Mithril.js 0.x
Stars: ✭ 370 (-74.16%)
Mutual labels:  deprecated, unmaintained
React Heatpack
A 'heatpack' command for quick React development with webpack hot reloading
Stars: ✭ 354 (-75.28%)
Mutual labels:  deprecated, unmaintained
Vagrant Librarian Chef
*UNMAINTAINED* A Vagrant plugin to install Chef cookbooks using Librarian-Chef.
Stars: ✭ 80 (-94.41%)
Mutual labels:  deprecated, unmaintained
React Axe
[DEPRECATED] Accessibility auditing for React.js applications
Stars: ✭ 1,201 (-16.13%)
Mutual labels:  deprecated, unmaintained
Framework7 With Angularjs Demo App
⛔️ Unmaintained and deprecated!
Stars: ✭ 81 (-94.34%)
Mutual labels:  deprecated, unmaintained
Haha
DEPRECATED Java library to automate the analysis of Android heap dumps.
Stars: ✭ 1,337 (-6.63%)
Mutual labels:  deprecated
Gulp Vulcanize
Concatenate a set of Web Components into one file
Stars: ✭ 101 (-92.95%)
Mutual labels:  deprecated
React Combinators
[NOT MAINTAINED] Seamless combination of React and reactive programming
Stars: ✭ 95 (-93.37%)
Mutual labels:  deprecated
Gphotos Sync
DEPRECATED - Google Photos Simple Synchronization Tool
Stars: ✭ 94 (-93.44%)
Mutual labels:  deprecated
Pytest Ipdb
Provides ipdb on failures for py.test.
Stars: ✭ 104 (-92.74%)
Mutual labels:  deprecated
Gulp Ftp
[DEPRECATED] Upload files to an FTP-server
Stars: ✭ 100 (-93.02%)
Mutual labels:  deprecated

🚨 Warning

This repository is DEPRECATED and not maintained anymore.


Custom camera with AVFoundation. Beautiful, light and easy to integrate with iOS projects. Compatible with Objective-C and Swift.

Build Status  License MIT  Cocoapods  Cocoapods  Analytics

  • Completely custom camera with AVFoundation
  • Custom view with camera permission denied
  • Custom button colors
  • Easy way to access album (camera roll)
  • Flash auto, off and on
  • Focus
  • Front and back camera
  • Grid view
  • Preview photo view with three filters (fast processing)
  • Visual effects like Instagram iOS app
  • iPhone, iPod and iPad supported

Requirements: iOS 8 or higher.

Who uses it

Find out who uses TGCameraViewController and add your app to the list.

Adding to your project

CocoaPods is the recommended way to add TGCameraViewController to your project.

Add a pod entry for TGCameraViewController to your Podfile:

pod 'TGCameraViewController'

Install the pod by running:

pod install

Alternatively, you can download the latest code version directly and import the files to your project.

Privacy (iOS 10)

If you are building your app with iOS 10 or newer, you need to add two privacy keys to your app's Info.plist to allow the usage of the camera and photo library, or your app will crash.

Add the keys below to the <dict> tag of your Info.plist, replacing the strings with the description you want to provide when prompting the user:

	<key>NSPhotoLibraryUsageDescription</key>
	<string>Enable Photos access to import photos from your library.</string>
	<key>NSCameraUsageDescription</key>
	<string>Enable Camera to take photos.</string>

Usage

Here are some usage examples with Objective-C. You can find example projects for Objective-C and Swift 3 cloning the project. Refer to version 2.2.5 if you need a Swift 2.3 example.

Take photo

#import "TGCameraViewController.h"

@interface TGViewController : UIViewController <TGCameraDelegate>

@property (strong, nonatomic) IBOutlet UIImageView *photoView;

- (IBAction)takePhotoTapped;

@end



@implementation TGViewController

- (IBAction)takePhotoTapped
{
    TGCameraNavigationController *navigationController =
    [TGCameraNavigationController newWithCameraDelegate:self];

    [self presentViewController:navigationController animated:YES completion:nil];
}

#pragma mark - TGCameraDelegate optional

- (void)cameraWillTakePhoto
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (void)cameraDidSavePhotoAtPath:(NSURL *)assetURL
{
    // When this method is implemented, an image will be saved on the user's device
    NSLog(@"%s album path: %@", __PRETTY_FUNCTION__, assetURL);
}

- (void)cameraDidSavePhotoWithError:(NSError *)error
{
    NSLog(@"%s error: %@", __PRETTY_FUNCTION__, error);
}

#pragma mark - TGCameraDelegate required

- (void)cameraDidCancel
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)cameraDidTakePhoto:(UIImage *)image
{
    _photoView.image = image;
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)cameraDidSelectAlbumPhoto:(UIImage *)image
{
    _photoView.image = image;
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end

Choose photo

#import "TGCameraViewController.h"

@interface TGViewController : UIViewController
<UINavigationControllerDelegate, UIImagePickerControllerDelegate>

@property (strong, nonatomic) IBOutlet UIImageView *photoView;

- (IBAction)chooseExistingPhotoTapped;

@end



@implementation TGViewController

- (IBAction)chooseExistingPhotoTapped
{
    UIImagePickerController *pickerController =
    [TGAlbum imagePickerControllerWithDelegate:self];

    [self presentViewController:pickerController animated:YES completion:nil];
}

#pragma mark - UIImagePickerControllerDelegate

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    _photoView.image = [TGAlbum imageWithMediaInfo:info];
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end

Change colors

@implementation TGViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    UIColor *tintColor = [UIColor greenColor];
    [TGCameraColor setTintColor:tintColor];
}

@end

Options

Option Type Default Description
kTGCameraOptionHiddenToggleButton NSNumber (YES/NO) NO Displays or hides the button that switches between the front and rear camera
kTGCameraOptionHiddenAlbumButton NSNumber (YES/NO) NO Displays or hides the button that allows the user to select a photo from their album
kTGCameraOptionHiddenFilterButton NSNumber (YES/NO) NO Displays or hides the button that allos the user to filter their photo
kTGCameraOptionSaveImageToAlbum NSNumber (YES/NO) NO Save or not the photo in the camera roll
kTGCameraOptionUseOriginalAspect NSNumber (YES/NO) NO Use the original aspect instead of cropping the image to a square
#import "TGCamera.h"

@implementation UIViewController

- (void)viewDidLoad
{
    //...
    [TGCamera setOption:kTGCameraOptionHiddenToggleButton value:@YES];
    [TGCamera setOption:kTGCameraOptionHiddenAlbumButton value:@YES];
    [TGCamera setOption:kTGCameraOptionHiddenFilterButton value:@YES];
    [TGCamera setOption:kTGCameraOptionSaveImageToAlbum value:@YES];
    //...
}

- (IBAction)buttonTapped
{
    //...
    BOOL hiddenToggleButton = [[TGCamera getOption:kTGCameraOptionHiddenToggleButton] boolValue];
    BOOL hiddenAlbumButton = [[TGCamera getOption:kTGCameraOptionHiddenAlbumButton] boolValue];
    BOOL hiddenFilterButton = [[TGCamera getOption:kTGCameraOptionHiddenFilterButton] boolValue];
    BOOL saveToDevice = [[TGCamera getOption:kTGCameraOptionSaveImageToAlbum] boolValue];
    //...    
}

@end

Requirements

TGCameraViewController works on iOS 8.0+ version and is compatible with ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates:

  • AssetsLibrary.framework
  • AVFoundation.framework
  • CoreImage.framework
  • Foundation.framework
  • MobileCoreServices.framework
  • UIKit.framework

You will need LLVM 3.0 or later in order to build TGCameraViewController.

To do

  • Landscape mode support
  • Zoom
  • Image size as global parameter
  • Fast animations
  • Create a custom picker controller
  • Zoom does not work with the camera roll pictures

License

This code is distributed under the terms and conditions of the MIT license.

Change log

A brief summary of each TGCameraViewController release can be found on the releases.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].