Easy custom camera

Easy custom camera

Source code introduction

This is a simple custom camera, LLsimpleCamera control can realize a snapchat-like camera screen, which can easily capture images, handle position and flash, and hide the details related to developers.
Source code running screenshot

Source code snippet

  1. - ( void )snapButtonPressed:(UIButton *)button {
  2. [self.camera capture];
  3. }
  4.   
  5. /* camera delegates */  
  6. - ( void )cameraViewController:(LLSimpleCamera *)cameraVC didCaptureImage:(UIImage *)image {
  7. // we should stop the camera, since we don't need it anymore. We will open a new vc.  
  8. [self.camera stop];
  9.       
  10. ImageViewController *imageVC = [[ImageViewController alloc] initWithImage:image];
  11. [self presentViewController:imageVC animated:NO completion:nil];
  12. }
  13.   
  14. - ( void )cameraViewController:(LLSimpleCamera *)cameraVC didChangeDevice:(AVCaptureDevice *)device {
  15. // device changed, check if flash is available  
  16. if (cameraVC.isFlashAvailable) {
  17. self.flashButton.hidden = NO;
  18. }
  19. else {
  20. self.flashButton.hidden = YES;
  21. }
  22.       
  23. self.flashButton.selected = NO;
  24. }

Source code link: http://download..com/data/1975253

<<:  Wandoujia opens up a new way to discover personalized content

>>:  GuessGame——Guessing Game

Recommend

Xunlei Kankan CEO: This is how you should analyze user needs!

There is no need to elaborate on how important us...

My Brand Methodology

In this article, I want to summarize the "br...

An article that analyzes user operations in detail!

Preface I recently browsed recruitment informatio...

Event planning and promotion process!

When talking about the "crash" experien...

@If you often watch short videos, your brain may be affected!

To reduce the time spent on short videos and get ...

Intel thinks the 'Jellyfish' graphics card virus isn't that scary

In May this year, a group of security experts cam...

Fecal treatment technology: a "wonderful adventure" of human microorganisms!

Fecal disease treatment technology: a wonderful a...

Promotion and traffic generation: How to use Zhihu to attract traffic and fans?

I believe everyone knows Zhihu, which gathers pro...

700 paying users and 1,000 UGC operation cases in 3 months, how did they do it?

I have seen many products that were poorly made. ...

Very interesting, how to view code as a crime scene

Measuring software complexity is a popular and co...

How to conduct data analysis for information flow advertising?

During the Internet advertising process, the oper...

The truth about "oyster sauce can increase uric acid levels" →

Recently, several friends asked me the same quest...