Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 beta - playbackState is only available in iOS 13.0 or newer

Tags:

ios

swift

xcode11

I'm getting error: 'playbackState' is only available in iOS 13.0 or newer

but MPNowPlayingInfoCenter.playbackState was used in my app for iOS 11.

This is issue of iOS 13? Can I handle it now?

was in iOS11:

@available(iOS 5.0, *)
open class MPNowPlayingInfoCenter : NSObject {

    open class func `default`() -> MPNowPlayingInfoCenter

    open var nowPlayingInfo: [String : Any]?

    open var playbackState: MPNowPlayingPlaybackState
}

now in iOS 13:

@available(iOS 5.0, *)
open class MPNowPlayingInfoCenter : NSObject {

    open class func `default`() -> MPNowPlayingInfoCenter

    open var nowPlayingInfo: [String : Any]?

    @available(iOS 13.0, *)
    open var playbackState: MPNowPlayingPlaybackState
}
like image 976
Dmytro Avatar asked Jul 15 '19 10:07

Dmytro


1 Answers

I filed a bug report to Apple and below is the response from Apple Engineering:

This API is only supported on macOS and Catalyst. It was mistakenly marked available in a previous release, but it has been corrected. We were requested to not mark this API as available specifically for Catalyst, but macOS platform is the only place where this API works.

like image 117
X. W Avatar answered Oct 22 '22 19:10

X. W