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

A practical methodology for building a brand on Xiaohongshu

Today I wrote some content that I shouldn’t have ...

Before driving, you need a good piece of rubber!

This article was first published by Hunzhi (WeCha...

Mobile and PC management: a difficult but unstoppable path to merger

[[124757]] Obviously, we only jump into a trend w...

Analysis of the marketing and promotion model of UnionPay QuickPass!

In the past two years, the eye-catching red adver...

Bacteria conspire, viruses eavesdrop: quorum sensing in microbes

A month ago, we reported that the 2022 Wolf Prize...

Example of using multiple Storyboards in one project

Source code introduction: The problem with using ...

What are the specific methods of selling products on Douyin?

From Haidilao to Daancha, Douyin has demonstrated...

Can Cook's surprising move to resell iPhone 6 bring Apple back to life?

There has always been such a joke that in the sum...