# Building a Camera App With SwiftUI and Combine | Kodeco, the new raywenderlich.com

**URL:** <https://forums.kodeco.com/t/building-a-camera-app-with-swiftui-and-combine-kodeco-the-new-raywenderlich-com/181736>\
**Category:** 🎓 Courses & Articles\
**Created:** [December 15, 2022, 1:32pm UTC](https://forums.kodeco.com/t/building-a-camera-app-with-swiftui-and-combine-kodeco-the-new-raywenderlich-com/181736 "2022-12-15T13:32:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![toojuice](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/toojuice/32/100912_2.png) [@toojuice](https://forums.kodeco.com/u/toojuice)\
**Post date:** [December 15, 2022, 1:32pm UTC](https://forums.kodeco.com/t/building-a-camera-app-with-swiftui-and-combine-kodeco-the-new-raywenderlich-com/181736/1 "2022-12-15T13:32:40Z")

</div>

Learn to natively build your own SwiftUI camera app using Combine and create fun filters using the power of Core Image.

* * *
This is a companion discussion topic for the original entry at [https://www.kodeco.com/26244793-building-a-camera-app-with-swiftui-and-combine](https://www.kodeco.com/26244793-building-a-camera-app-with-swiftui-and-combine)

---

<div class="post-metadata">

**Author:** ![numberbay](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/numberbay/32/105896_2.png) [@numberbay](https://forums.kodeco.com/u/numberbay)\
**Post date:** [December 21, 2022, 1:05am UTC](https://forums.kodeco.com/t/building-a-camera-app-with-swiftui-and-combine-kodeco-the-new-raywenderlich-com/181736/2 "2022-12-21T01:05:20Z")

</div>

Nice to use SwiftUI and Combine to render the live video stream. But how efficient is this and how does this compare to the most efficient method?

---

<div class="post-metadata">

**Author:** ![jeff.orthober.sr](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@jeff.orthober.sr](https://forums.kodeco.com/u/jeff.orthober.sr)\
**Post date:** [November 7, 2023, 3:46am UTC](https://forums.kodeco.com/t/building-a-camera-app-with-swiftui-and-combine-kodeco-the-new-raywenderlich-com/181736/3 "2023-11-07T03:46:53Z")

</div>

This was a very nice tutorial, but with the latest stuff had to fix a couple of things.

1. Had to change  
.compactMap { buffer in  
return CGImage.create(from: buffer)

* * *

## to

.compactMap { buffer in  
return CGImage.create(from: buffer!)

This was bugging out do to empty buffer for a bit, so had to do something like this

if buffer != nil  
{  
return createCGImage(from: buffer!)  
}  
else  
{  
return drawMyImage()  
}  
Where drawMyImage is a simple CGImage Creator that is needed until things spin up.

Also what is missing I think is  
enum CameraError  
{  
case deniedAuthorization  
case restrictedAuthorization  
case unknownAuthorization  
case cameraUnavailable  
case cannotAddInput  
case cannotAddOutput  
case createCaptureInput  
}

BUT THIS IS A VERY NICE TUTORIAL

---

<div class="post-metadata">

**Author:** ![jamuel](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@jamuel](https://forums.kodeco.com/u/jamuel)\
**Post date:** [November 22, 2023, 2:25pm UTC](https://forums.kodeco.com/t/building-a-camera-app-with-swiftui-and-combine-kodeco-the-new-raywenderlich-com/181736/4 "2023-11-22T14:25:50Z")

</div>

Could you please add a dection of how to add a shutter button and sction the capture?
