Giter VIP home page Giter VIP logo

zcsavatarcapture's Introduction

ZCSAvatarCapture

You've got user avatars in your app. You probably don't have user avatar editing as nice as this.

Add to your Podfile

pod 'ZCSAvatarCapture', '~> 0.0.5'

Use in your project

Setup

#import "ZCSAvatarCaptureController.h"

ZCSAvatarCaptureController *avatarCaptureController = [[ZCSAvatarCaptureController alloc] init];
avatarCaptureController.delegate = self;
avatarCaptureController.image = [UIImage imageNamed:@"model-001.jpg"]; // Use your current avatar image here
[self.avatarView addSubview:self.avatarCaptureController.view]; // self.avatarView is a placeholder on the Storyboard in this example

// You can manually initiate a capture session like so (thanks to @ssuchanowski)
[avatarCaptureController startCapture];

Capture

The delegate method imageSelected:(UIImage *)image will be called when the user completes capture.

- (void)imageSelected:(UIImage *)image {
	// Do something with your user's new avatar image
}

Screenshots

Example App with Avatar Example with Camera Example with Photo Example App after Avatar

Contributing

Send me Pull Requests here, please.

zcsavatarcapture's People

Contributors

ssuchanowski avatar

Stargazers

jay down avatar 安东尼 avatar Kai Li avatar Scott Johnson avatar José Torres Cardenas avatar Xue Feng avatar Miqdad Altaitoon avatar Karim Sallam avatar moflo avatar Trujun Zhang avatar Eugene Letenkov avatar Spike Deng avatar  avatar  avatar Austin Crane avatar Felix Dumit avatar Mauro M. Sacca' avatar Mohamed Adly Elgamasy avatar Summer avatar Thinh Phan avatar Raj Kadam avatar yezehui2002 avatar Lorenço avatar Echo Liao avatar Andrew Gertig avatar Martin Púčik avatar Aleksandar Vacić avatar haley. avatar Andrei Popovici avatar Zafer avatar x avatar Ahmet Günay avatar Charles Sieg avatar Luke Crawford avatar Rajesh Maurya avatar Marvin Nazari avatar Nikolay avatar Dimo Hamdy avatar zhuqling avatar  avatar Samet Dede avatar Alex Plekhanov avatar Shailendra Singh avatar Melvin avatar alacom avatar xueshi avatar  avatar Xavier avatar Syed Haris Hussain avatar Komkrit Kawichai avatar Terry Wang avatar Ricardo Pereira avatar Yozone Wang avatar Lex Tang avatar Richard Baker avatar danno watts avatar Carabineiro avatar Bruno Bilescky avatar Ahmad Atef avatar Oisín Hurley avatar samuele coppede avatar Alexis Gallagher avatar Indrajit Chakrabarty avatar Yothin Samrandee avatar Julian Weiss avatar Stefano Verna avatar Ethan Nagel avatar Jiashu Wang avatar Tim Kersey avatar

Watchers

Zane Shannon avatar James Cloos avatar Igor avatar Carabineiro avatar IGOR KRAVTCOV avatar  avatar

zcsavatarcapture's Issues

Crashes when capturing front facing photo.

I am playing around with the project demo and as soon as I tap the capture button, It crashes with this message*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'.

Tracing trough the debugger, I found the culprit.

bool isFrontFacing = self.captureDevice == [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo][1];

and then I change from that to this

bool isFrontFacing = self.captureDevice == [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo][0];

and it seems to work fine now.

Cool library anyway. 👍

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.