Documentation Archive Developer
Search

AVKit Changes for Swift

AVKit

Declaration
From
class AVPlayerViewController : UIViewController {
    var player: AVPlayer!
    var showsPlaybackControls: Bool
    var videoGravity: String!
    var readyForDisplay: Bool { get }
    var videoBounds: CGRect { get }
    var contentOverlayView: UIView! { get }
}
extension AVPlayerViewController {
    class func preparePrerollAds()
    func playPrerollAdWithCompletionHandler(_ completionHandler: ((NSError!) -> Void)!)
    func cancelPreroll()
}
To
class AVPlayerViewController : UIViewController {
    var player: AVPlayer?
    var showsPlaybackControls: Bool
    var videoGravity: String
    var readyForDisplay: Bool { get }
    var videoBounds: CGRect { get }
    var contentOverlayView: UIView? { get }
    var allowsPictureInPicturePlayback: Bool
    weak var delegate: AVPlayerViewControllerDelegate?
}
extension AVPlayerViewController {
    class func preparePrerollAds()
    func playPrerollAdWithCompletionHandler(_ completionHandler: ((NSError!) -> Void)!)
    func cancelPreroll()
}

Declaration
From
var contentOverlayView: UIView! { get }
To
var contentOverlayView: UIView? { get }

Declaration
From
var player: AVPlayer!
To
var player: AVPlayer?

Declaration
From
var videoGravity: String!
To
var videoGravity: String