picker = MPMediaPickerController(mediaTypes: MPMediaType.music)
picker.prompt = ""
picker.showsCloudItems = true
picker.allowsPickingMultipleItems = true
picker.delegate = self
var canOpenMusic = false
self.present(picker, animated: true) {
//如果安装有音乐,就会执行当前代码
canOpenMusic = true
}
//就是通过canOpenMusic 延迟1s判断
我这儿的作用主要是用于,在未安装的时候提示,安装就直接跳转。