Error loading media sources in MLMediaLibrary
Turns out there were two things amiss:
1. The MLMediaLoadIncludeSourcesKey
should point to an array of strings, not a single string
2. The observation key path was wrong, should be "mediaSources"
, was missing an s
XPC error when using MLMediaLibrary from command line daemon
In order to access MLMediaLibrary
your application has to be sandboxed and codesigned.
Update
It seems like you also have to add some permanent read-only access entitlements to your .entitlements file.
If you want to access Photos, iPhoto or Aperture libraries:
<key>com.apple.security.assets.pictures.read-only</key>
<true/>
If you want to access iMovie and FinalCut:
<key>com.apple.security.assets.movies.read-only</key>
<true/>
If you want to access iTunes or Logic:
<key>com.apple.security.assets.music.read-only</key>
<true/>
You can read about my poor experience with a MediaLibrary framework here:
https://devforums.apple.com/message/1125821
Related Topics
How to Create an iOS Liveview in Xcode 8/Swift 3
Using Getters and Setters to Modify Values W/O Subclassing in Swift
Using Multiple Hosting Controllers in Swiftui on Watchos
Dependency Injection in View Controller
Struct Memberwise Initialization - Omitting Values for Properties That Have Defaults
How to Use Swipe to Dismiss While Presenting a Fullscreen Modal in iOS 13
Control a Nstabviewcontroller from Parent View
Cannot Convert [Int] to [Int] in Generic Implementation
Horizontal Scrolling in Spritekit (Vs. a Viewcontroller)
Picker Not Working When Editmode Is Active
How to Create a Pulse Effect on an Skspritenode
How to Fix Cannot Find 'Firebaseapp' in Scope
How to Override Setter in Swift
Tableview Image Content Selection Color
Uibutton Action Is Not Triggered After Constraint Layouts Changed