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

The correct approach to enterprise short video operation

First of all, for enterprises, it is obviously no...

How to reduce APP uninstall rate? Here are seven ways!

The mobile application market is now a crowded ma...

Will drinking edamame cause bone deformation? These things are the culprit

There was a news recently: An old man liked to ea...

QR code promotion, 6 invalid forms to avoid

When doing new media promotion , many operators d...

I advise you to pee and look in the mirror...well, to see if you are healthy!

Adult life is often a major rollover scene But I ...

Let’s talk about SwiftUI layout protocol

Introduction One of the best new features added t...

Community operation: What kind of community is considered a good community?

If you want to know what kind of community is rel...

WeChat update! You can finally block group chats

Hello my friends. I just had a day off yesterday ...

objc.io#21#Photo framework

introduce Every day, more photos are taken with a...

Android source code, excellent pedometer

Source code introduction: Excellent pedometer sou...

Barclays: Apple missed 5G in 2019 and will only use 4G in 2020

Apple's response to angry critics has been im...