简体   繁体   中英

Open gallery from app in swift

I wan't to let the user open the iPhone's gallery.

I do NOT need the user to pick a photo nor a video and come back to my app, I am aware that i can achieve this using the UIImagePickerController . What I want is that the iOS gallery app is opened and set active.

As said in this SO question , i know you can use other apps using UIApplication.shared.canOpenURL(url) with the correct url, does it exist a url that I can use for this or is there another method? thanks!.

I'm not sure what you mean by « gallery », but if what you're looking for is opening the Photos app, you may try with this URL: photos-redirect:// Be aware that this is not a publicly documented URL scheme so maybe Apple will not accept its use and may reject your app during review...

Sources: https://ios.gadgethacks.com/news/always-updated-list-ios-app-url-scheme-names-0184033/ and Is it possible to launch (redirect the user to) the native photo gallery application of iphone from my app,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM