Move an image from Photos macOS app to trash programmatically - swift

I want to remove a photo(move to Recently Deleted Album) from Photos macOS app using swift and MediaLibrary framework.
MediaLibrary framework provides read-only acces to Photos Library on mac so I belive it wont help and I can't find any other framework who provides read and write acces like Photos framework does for iOS.
Any advice is welcome.

Related

Uploading files from iOS Files app in another app

I'm looking to add functionality to my app that would allow a user to upload a file within my app from the Files app that was introduced in iOS 11. I would expect that it would work the same way that existing components do now where you can select Upload a Photo or Video on your iOS device and it allows you to select items from within the Photos app. I have been searching and I have not been able to figure out a way to do this. I know Apple's Mail app has this functionality (under "Add Attachment"), but I have not found a way to surface this functionality in my own app.
Since I am using Eureka for my other row inputs, it would be ideal to have this in an Eureka component but right now I am just trying to figure out if it is even possible to select files from the Files app from another app with Apple's existing APIs.
The Framework you are looking for is built in to UIKit in a class called UIDocumentPickerViewController

Creating a new directory in the photo library of iPhone using PhoneGap

I am currently developing an mobile app using the PhoneGap framework. I am just wondering if there is any PhoneGap APIs or plugins that will allow us to create a new directory inside the iPhone's photo library. So every time when a user is using my app to capture a picture, I can have it saved into that directory.
From my little knowledge, currently you cant create a new directory inside the iPhone's photo library using phoneGap
However you can save an image in to iPhone's photo library.
See the below code
save image
function runImageTest(img)
{
PhoneGap.exec("ImageHelper.saveToUserLibrary",img);
}
Please see the discussions here

How can I retrieve and copy all photos/videos from Photos app to my app programmatically?

How can I retrieve and copy all photos/videos from Photos app to my application programmatically?
You need to make use of ALAssetsLibrary for iOS 4.0–9.0, or the Photos framework for iOS 8.0 and newer.
I don't think it's possible - Apple doesn't allow access to the photo library. (although i'm sure there is a way through jailbreak/private methods, but it won't be sanctioned by Apple).
You can, however, save photos with UIImageWriteToSavedPhotosAlbum and pick photos manually from the photo library with UIImagePickerController.
EDIT: Actually, it looks like you can get photos using the Assets Library. Check out this tutorial.

Access Photo Library without using UIImagePickerController

Everyone.
Is there any way of accessing photos on my iphone without using UIImagePickerController?
Can I somehow use NSFileManager for this purpose? If not then is there any alternative?
Best Regards.
The Assets Library Framework allows you to access the photos and videos managed by the Photos application, which includes those that are in the saved photos album, those coming from iTunes and those that were directly imported into the device
See the official docs for more information.
There's also a very good tutorial here on how to use it, including a video.

Accessing music library in iPhone OS 3.0

My requirement is that i want to access the list of all the songs from the iPhone library.
I have included the MediaPlayer Framework in my project. So how to get the list of all the songs ???
Thanks.
Check out apple's AddMusic sample code, it has the entire thing.
http://developer.apple.com/iphone/library/samplecode/AddMusic/