Files
PlayerKit/Sources/PlayerView.swift
Bryant Balatbat aa23c953ca CRI-1212: Integrate macOS changes (#92)
* Add support for macOS

- Add PlayerView for switching between UIKit and AppKit view class
- Remove imports of UIKit
- Replace UIView uses with PlayerView
- Add #if for cases that are not supported on macOS
- Update podspec for macOS specific configuration

* Add documentation for PlayerView

* Fix brace placement

* Lower macOS minimum deployment target

* Change type oif RegularPlayerView to PlayerView

* Updated parameters to support macOS and tvOS

* Switch to canImport() from os()

* Revert canImport() back to os() in on instance
2019-08-19 15:24:19 -04:00

19 lines
587 B
Swift

//
// PlayerView.swift
// PlayerKit
//
// Created by Balatbat, Bryant on 12/20/17.
//
/// This file creates a `typealias` called `PlayerView` that determines which core view component to use depending on
/// which platform the binary is being compiled for. If iOS or tvOS, `UIKit` will be imported and `UIView` will be used.
/// otherwise, if macOS is used, `AppKit` will be imported and `NSView` will be used.
#if canImport(UIKit)
import UIKit
public typealias PlayerView = UIView
#elseif canImport(AppKit)
import AppKit
public typealias PlayerView = NSView
#endif