Ahmed Mourad
10/17/2023, 2:41 AM<key>NSAppleMusicUsageDescription</key>
<string>...</string>
and this's the picker implementation:
class RingtonePickerController(
private val parent: UIViewController
) : NSObject(), MPMediaPickerControllerDelegateProtocol {
private var mediaPicker: MPMediaPickerController? = null
fun showRingtonePicker() {
mediaPicker = MPMediaPickerController(MPMediaTypeAnyAudio)
mediaPicker?.delegate = this
mediaPicker?.allowsPickingMultipleItems = false
parent.presentViewController(mediaPicker!!, animated = false, completion = null)
}
override fun mediaPickerDidCancel(mediaPicker: MPMediaPickerController) {
mediaPicker.dismissViewControllerAnimated(true, completion = null)
}
override fun mediaPicker(mediaPicker: MPMediaPickerController, didPickMediaItems: MPMediaItemCollection) {
val selectedItems = didPickMediaItems.items()
// Do something with the selected media items
mediaPicker.dismissViewControllerAnimated(true, completion = null)
}
}
it doesn't work tho for some reason? whenever I call the showRingtonePicker method the ui will freeze for a second indicating that something is being pushed in front of my current controller, but then it just goes back to normal with nothing happeningAndrei Salavei
10/17/2023, 9:36 AMAhmed Mourad
10/17/2023, 12:35 PMCherrio LLC
10/17/2023, 10:16 PMiosMain
?Ahmed Mourad
10/18/2023, 2:25 AMCherrio LLC
10/18/2023, 6:22 AM