-7

I know this topic has been discussed before. Im beginner so I tried my best but couldn't get past the error. I am following youtube tutorial on making an app to use iOS camera. I believe they used swift 3 and older iOS so Im guessing that's the issue here. I took their source code and still got same error.enter image description here

enter image description here

1 Answers1

0

currentCamera appears to be nil and you are trying to force-unwrap it. This might be why you have a crash. I would try to understand why that local variable is nil and not the value you think that it is, before you try force-unwrapping it.

If "force unwrapping" is foreign to you, I'd read up on the some of the basics of how Optionals work in Swift. There is a lot of content out there on how to deal with Optionals values.

Aaron
  • 7,055
  • 2
  • 38
  • 53