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

10 ways to ensure your app passes Apple review!

Recently, Apple listed the ten sins on its develo...

Did the male mantis in "Black Cat Sheriff" really volunteer to be eaten?

If dating means potentially losing your life, wou...

8 steps and 5 stages to build a private community SOP from 0 to 1

There is more and more consensus on doing private...

Baofeng TV's model of achieving profitability within 5 years is questionable

Shenzhen Baofeng Tongshuai Technology Co., Ltd. (...

Cook: Android malware is 47 times more than iOS

One of the biggest advantages of Android over iOS...

Zhangye Binggou Danxia: Desolate and lonely beauty

Danxia is a red landform first discovered and nam...

“Street stall economy” brand leverages marketing and copywriting!

The way people greet each other these days has ch...