Image sharing in iOS - ios

In iOS I noticed you can select a photo in your Photo app and then share it using other apps (eg. Whatsapp, Telegram, etc.). I would like to implement the same functionality in my app, but I don't know where to start. Can you help me? The things I don't understand are:
how my app can be listed between the apps that can share images;
how my app "knows" what to do when a user selects an image;
I know this is basic, maybe trivial, but I searched a little maybe using the wrong keywords, I dunno.
Any help is appreciated.

Here is a reference on accessing images iOS:
Open gallery with photos and videos
Here are some references on sharing images with iOS:
Sharing and Actions
App Extension Essentials

Related

how can I show selected image in Photos app

currently in my app I'm fetching the images from Photos app and showing them in my app.
in my app when user click the image
I want to open Photos app with selected image ,is there any way to do this?
You can't do that.
Also, There is not officially documented way to open Photos App as well.
You might, still open the Photos application using photos-redirect:// url scheme but this is also not documented by Apple to use so you might face some problems with it during the review process.
Opening to certain pre-selected photo in the Photos application is not possible.

LinkedIn native sharing iOS issue

Our team develops an app which has a possibility to share posts via iOS native sharing. And we have some questions regarding LinkedIn app:
We can't share images via LinkedIn iOS app. The image is present on the preview, but not in the shared posts.
After the last app update, we can't share posts with images at all. When we share the image - we receive the error (see image attached). Also as we checked other apps and they have the same problems with sharing posts with images.
Here a screenshot with an error message:
Could anyone help me with this?
Thank you in advance!

Integrating Live Photos in my app

I have some live photos that I am trying to use in my app. I am kind of confused on how to integrate them so I can use it in the app. I currently have an image view, but how do I add the live photo to it?
There is really no simple out-of-the-box API from Apple to integrate Live Photo in iOS apps.
That being said, there's an interesting article that has been going around lately which will explain what Live Photo is under the hood and how you can use it.
PHLivePhoto & PHLivePhotoView are available in iOS 9.1+
https://developer.apple.com/library/ios/documentation/Photos/Reference/PHLivePhoto_Class/index.html#//apple_ref/occ/cl/PHLivePhoto
https://developer.apple.com/library/ios/documentation/PhotosUI/Reference/PHLivePhotoView_Class/
These should be all you need to support Apple's Live Photos in your app.

How to make your app available in UIActivityViewcontroller listed activities

How to make your app available in UIActivityViewcontroller listed activities.
Im unable to find the exact name of this feature.
Here is what I wanna do. My app is a social app where whenever other apps will share the content in UIActivityViewController I want my app to appear in the activities list.
I Apologise that I have no idea about what it is called. Anyone can please help me out.
it's called App Extension, you can use share extensions to share the data between the extension and your app. For more information refer the App Extensions Guide

Is it possible to add an app to the native share dialog?

I am assuming it is not possible to add apps to the native share dialog, like the one used in the Camera Roll. However I see screenshots around with different apps in the dialog.
Is it only apps that are integrated in the OS that can be in this dialog? Or is it possible with some scheme or something?
I have researched the possibilities of UIDocumentInteractionController mentioned by 'The Tiger' and came to the conclusion that it is not possible.
I have looked at the Apple Documentation, declaring the Document Types in the info.plist works for other apps but not for Mail, Images / Camera Roll / etc; the native share dialogs.
Edit:
I really don't get the downvotes....
Here are some references that say it is not possible:
https://devforums.apple.com/thread/140939?tstart=0
why-cant-i-register-my-ios-application-to-handle-the-image-file-type
register-app-to-open-image-files
associate-audio-and-video-types-with-iphone-app
add-a-file-association-with-tiff-files-on-ios
associate-image-file-types-utis-with-ios-app-doesnt-show-open-in-in-m
You need to subclass UIActivity to achieve this.
Theres an example for Dropbox:
https://github.com/goosoftware/GSDropboxActivity
Register your app as supporting the file types that you want to open and add the code to open them. See Document Interaction Programming Topics.

Resources