Skip to content

sajjadsarkoobi/SwiftUICameraView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Camera View - SwiftUI | Combine & AVKit

Creating Camera View based on Combine & SwiftUI

Presenting the camera view and accessing each frame have never been so much easier rather than this. But which is more efficient and right for your use cases?

  • Using Combine and SwiftUI
  • AVKit with AVCaptureVideoPreviewLayer

Check it out on my Youtube Channel SwiftAcademy:

Preview

Preview

How it works

SwiftUI is a declarative program, which means that it creates its views each time something changes in the data that it should be presented.

So with the help of AvFoundation and accessing the camera as an input device for AVSession, we can have each frame as a CVImageBuffer as an output.

So then with the help of Combine we can publish each frame and present it. The huge benefit of that you can manipulate and add filters or even change one frame :).

Best Use cases:

  • Creating a filter app
  • Computer vision
  • Image processing

Author:

About

Creating Camera View based on Combine & SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages