Documentation Archive Developer
Search

AVKit Changes for Swift

AVKit

Modified AVCaptureView
Declaration
From
class AVCaptureView : NSView {
    var session: AVCaptureSession! { get }
    func setSession(_ session: AVCaptureSession!, showVideoPreview showVideoPreview: Bool, showAudioPreview showAudioPreview: Bool)
    var fileOutput: AVCaptureFileOutput! { get }
    weak var delegate: AVCaptureViewDelegate!
    var controlsStyle: AVCaptureViewControlsStyle
    var videoGravity: String!
}
To
class AVCaptureView : NSView {
    var session: AVCaptureSession? { get }
    func setSession(_ session: AVCaptureSession?, showVideoPreview showVideoPreview: Bool, showAudioPreview showAudioPreview: Bool)
    var fileOutput: AVCaptureFileOutput? { get }
    weak var delegate: AVCaptureViewDelegate?
    var controlsStyle: AVCaptureViewControlsStyle
    var videoGravity: String
}

Declaration
From
weak var delegate: AVCaptureViewDelegate!
To
weak var delegate: AVCaptureViewDelegate?

Declaration
From
var fileOutput: AVCaptureFileOutput! { get }
To
var fileOutput: AVCaptureFileOutput? { get }

Declaration
From
var session: AVCaptureSession! { get }
To
var session: AVCaptureSession? { get }

Declaration
From
func setSession(_ session: AVCaptureSession!, showVideoPreview showVideoPreview: Bool, showAudioPreview showAudioPreview: Bool)
To
func setSession(_ session: AVCaptureSession?, showVideoPreview showVideoPreview: Bool, showAudioPreview showAudioPreview: Bool)

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

DeclarationRaw Value Type
From
enum AVCaptureViewControlsStyle : Int {
    case Inline
    case Floating
    case InlineDeviceSelection
}
--
To
enum AVCaptureViewControlsStyle : Int {
    case Inline
    case Floating
    case InlineDeviceSelection
    static var Default: AVCaptureViewControlsStyle { get }
}
Int

Declaration
From
protocol AVCaptureViewDelegate : NSObjectProtocol {
    func captureView(_ captureView: AVCaptureView!, startRecordingToFileOutput fileOutput: AVCaptureFileOutput!)
}
To
protocol AVCaptureViewDelegate : NSObjectProtocol {
    func captureView(_ captureView: AVCaptureView, startRecordingToFileOutput fileOutput: AVCaptureFileOutput)
}

Declaration
From
func captureView(_ captureView: AVCaptureView!, startRecordingToFileOutput fileOutput: AVCaptureFileOutput!)
To
func captureView(_ captureView: AVCaptureView, startRecordingToFileOutput fileOutput: AVCaptureFileOutput)

Modified AVPlayerView
Declaration
From
class AVPlayerView : NSView {
    var player: AVPlayer!
    var controlsStyle: AVPlayerViewControlsStyle
    var videoGravity: String!
    var readyForDisplay: Bool { get }
    var videoBounds: NSRect { get }
    var contentOverlayView: NSView! { get }
}
extension AVPlayerView {
    var showsFrameSteppingButtons: Bool
    var showsSharingServiceButton: Bool
    var actionPopUpButtonMenu: NSMenu!
    var showsFullScreenToggleButton: Bool
}
extension AVPlayerView {
    var canBeginTrimming: Bool { get }
    func beginTrimmingWithCompletionHandler(_ handler: ((AVPlayerViewTrimResult) -> Void)!)
}
extension AVPlayerView {
    func flashChapterNumber(_ chapterNumber: Int, chapterTitle chapterTitle: String!)
}
To
class AVPlayerView : NSView {
    var player: AVPlayer?
    var controlsStyle: AVPlayerViewControlsStyle
    var videoGravity: String
    var readyForDisplay: Bool { get }
    var videoBounds: NSRect { get }
    var contentOverlayView: NSView? { get }
}
extension AVPlayerView {
    var showsFrameSteppingButtons: Bool
    var showsSharingServiceButton: Bool
    var actionPopUpButtonMenu: NSMenu?
    var showsFullScreenToggleButton: Bool
}
extension AVPlayerView {
    var canBeginTrimming: Bool { get }
    func beginTrimmingWithCompletionHandler(_ handler: ((AVPlayerViewTrimResult) -> Void)?)
}
extension AVPlayerView {
    func flashChapterNumber(_ chapterNumber: Int, chapterTitle chapterTitle: String)
}

Declaration
From
var actionPopUpButtonMenu: NSMenu!
To
var actionPopUpButtonMenu: NSMenu?

Declaration
From
func beginTrimmingWithCompletionHandler(_ handler: ((AVPlayerViewTrimResult) -> Void)!)
To
func beginTrimmingWithCompletionHandler(_ handler: ((AVPlayerViewTrimResult) -> Void)?)

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

Declaration
From
func flashChapterNumber(_ chapterNumber: Int, chapterTitle chapterTitle: String!)
To
func flashChapterNumber(_ chapterNumber: Int, chapterTitle chapterTitle: String)

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

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

DeclarationRaw Value Type
From
enum AVPlayerViewControlsStyle : Int {
    case None
    case Inline
    case Floating
    case Minimal
}
--
To
enum AVPlayerViewControlsStyle : Int {
    case None
    case Inline
    case Floating
    case Minimal
    static var Default: AVPlayerViewControlsStyle { get }
}
Int

Raw Value Type
From--
ToInt