The PHPhotoLibrary framework provides interfaces for viewing, editing and creating assets and collections managed by the IOS Photos app.
Questions tagged [phphotolibrary]
196 questions
0
votes
0 answers
iOS - Not able to save .MOV & .jpg as LivePhoto - Showing Error NSCocoaErrorDomain Code=-1 [Objective C]
I want to create live photo programatically with mixture of jpg and MOV. below is my code for implementation
These are links for files
jpg File - http://18.220.72.107/hd_wallpapers/images/animation/43625_wallpaper-2.jpg
MOV File -…

rathodbhavikk
- 416
- 7
- 20
0
votes
1 answer
Why does a shared video send upside down to only some other apps?
My iOS app using Swift 4 has the ability to save or share videos that were taken from the front or back camera. In the instance where I take a selfie video, using the front facing camera, and share the video to another application, it sends it…

Chewie The Chorkie
- 4,896
- 9
- 46
- 90
0
votes
1 answer
Save image to a specific photo album, but restrict to save into camera roll folder
I need a little bit of help in here, I have a method that saves an UIImage into the my custom images folder, but images saving into the camera roll folder as well which is i don't want.
Please, can anyone suggest me how can i restrict to save into…

TechValens
- 437
- 6
- 20
0
votes
2 answers
How to insert a newly created PHAsset at a specific position in camera roll?
Is it possible to insert a new PHAsset to an appointed index in the camera roll?
I tried following:
let cam_req = PHAssetCollectionChangeRequest(for: camera_roll)
cam_req?.insertAssets([asset] as NSArray, at: IndexSet(integer: pos))
doesn't work.

al_lea
- 596
- 1
- 9
- 17
0
votes
1 answer
Delete last screenshot taken in iOS =>9 without user authorisation?
I've requirement to disable taking screenshot in iOS device. since Apple not giving support for that, another workaround Im trying is - get notified when screenshot is taken using UIApplicationUserDidTakeScreenshotNotification and get last photo…

kumara
- 69
- 6
0
votes
1 answer
How to access photos in Photos app on macOS
I'm trying to access photos stored in macOS Photos app and have this code in ViewController class.
import Cocoa
import Photos
class vcSecond: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
let fetchOptions =…

Dawy
- 770
- 6
- 23
0
votes
0 answers
How to optimize saving video to album faster?
I found that VLC.app save video to album quickly. But my code will cost long time. Or it crash. How can I optimazed it. (compare with same large video)
Here is my code.
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
assetId =…

zszen
- 1,428
- 1
- 14
- 18
0
votes
2 answers
How to get duplicated medias in Photo Library?
I want to find duplicated photos/videos in photo library and delete them. But I got confused how can I compare all photos to each other and find which of them are duplicated.
Comparing bytes is not useful, which way should I take?

Alper
- 1,415
- 2
- 13
- 20
0
votes
1 answer
Select multiple image from photo library using swift
I am new in IOS and i want to select multiple image from photo library using swift4 and get into array of images.Please help me to do this.

rachna sharma
- 111
- 2
- 3
- 13
0
votes
0 answers
Not able to save google drive videos to photo gallery
I am trying to save google drive videos in my photo gallery.
The code I am using:
@objc func saveVideosToPhone(videoURL:URL,viewController:UIViewController){
PHPhotoLibrary.requestAuthorization
{ (status) -> Void in
switch (status)
…

Pratz_iOS
- 67
- 1
- 8
0
votes
1 answer
Photos and Videos are not saving in my Custom Photo Album
Photos and videos are not saving in my custom photo album (TestAlbum). Instead, it is saving in the Camera Roll. Can you kindly help me to identify the issue and help me to correct the code.
PHPhotoLibrary.shared().performChanges({
let albumName…

Subs Dba
- 9
- 1
- 2
0
votes
1 answer
How to get location of Image from PHPhotoLibrary?
Since ALAssetLibrary Api is deprecated we are using PHPhotoLibrary to save images to PhotoAlbum
If we use ALAssetLibrary,we can able to get assetUri of the saved image, but we cannot able to get the same if we use PHPhotoLibrary .
Example For…

VenkyDhana
- 905
- 5
- 16
0
votes
1 answer
UIImagePickerController - Save Recorded Video to Camera Roll Error
I'm trying to save a video recorded with camera using the UIImagePickerController. I've tried two different ways, and both are not working at all.
First attempt:
if let pathURL = info["UIImagePickerControllerMediaURL"] as! URL?, mediaType ==…

manonthemoon
- 2,611
- 8
- 26
- 40
0
votes
1 answer
Swift 3 or 4 Saving to custum album creates duplicate images
I am saving images to a custom album after either select or camera completion. Obviously, after camera completion, there is only one image, but when a user selects images in the gallery picker, in the completion handler, when I save that image to…

Aryan Duntley
- 236
- 3
- 10
0
votes
0 answers
Understanding Old ALAsset Code
I am trying to go through and clean up some deprecation warnings by updating ALAsset with PHPhoto. I am getting confused by this code and need some help to make sure I am not missing something. I added in some comments about what is confusing me.
-…

Jaybit
- 1,864
- 1
- 13
- 20