Search code examples
iosswift2ios-camera

For iOS app development, is it possible to detect if the camera has taken a photo?


I am building an iOS app for iPhone that ideally would create an alert with various actions every time someone takes a picture using the pre-installed/generic camera app. Is it possible to detect if a photo or video has been taken? If so, how? (I am using Swift and Xcode 7 - would appreciate any assistance to be in swift, if possible.)


Solution

  • You can't get any sort of notification that the user just used the Camera app to take a photo or video.

    However, using the Photos framework, you can write code that lets you know when new assets are added to the photo library. But these new assets can come from syncing in addition to the user using the Camera app on the local device.

    See the Photos Framework Reference as well as several sample apps provided by Apple for details on using the Photos framework.