Monday, February 5, 2024
HomeiOS Developmentios - Easy method to make use of machine digital camera to...

ios – Easy method to make use of machine digital camera to take a photograph in swift


I am curious, is there a quite simple, ideally SwiftUI-native, iOS/iPadOS API obtainable that may permit the consumer to take a photograph that can be used instantly in my app (without having to go to digital camera roll)? I’ve discovered Apple’s “tutorial” on Capturing and Saving a Photograph, and I do know there may be at the very least one Stack Overflow reply on this space, however these are too convoluted in comparison with my expectations. I am on the lookout for an API like:

let pathToPhoto = CapturePhoto()

Perhaps it could return one thing in RAM as a substitute of on disk. Perhaps there can be non-obligatory parameters. However the level is, for a lot of use-cases, it should be this straightforward to get a photograph from no matter digital camera is hooked up to the machine. I do not thoughts if the API has full management of my app’s fundamental thread whereas the digital camera is energetic. I think about one thing just like the behaviour within the Messages app, if you select “Digital camera” from the “+” button.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments