Hi,
Please see my code below:
` func configureRequestButton() {
let button = UIButton()
button.setTitle("Test", for: .normal)
button.setTitleColor(.systemBlue,for: .normal)
button.addTarget(self,
action: #selector(button), <---- need the fuction to execute here
for: .touchUpInside)
StackView.addArrangedSubview(button)
}
func requestMusicAuthorization() async throws {
let authorizationStatus = await MusicAuthorization.request()
if authorizationStatus == .authorized {
isAuthorizedForMusicKit = true
} else {
// User denied permission.
}
}````
So I need to basically call that request music authorisation function in that test button but every time I do it says you have to conform it to object c if I do it crashes the app. I have done the Plist stuff. I am using UIKIt programmatically coding the UI. Can someone help because most of the api docs is based for swifUI for music kit.