Skip to content

Commit

Permalink
Use canImport(module) directive instead of os(name)
Browse files Browse the repository at this point in the history
  • Loading branch information
aplr committed Apr 11, 2021
1 parent 36daef3 commit 714267a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/Richi/VideoPlayer+Lifecycle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@
//


#if os(macOS)
#if canImport(AppKit)
import AppKit
#else
#elseif canImport(UIKit)
import UIKit
#endif

import Foundation

#if os(macOS)
#if canImport(AppKit)
fileprivate var WillResignActiveNotificationName = NSApplication.willResignActiveNotification
fileprivate var DidBecomeActiveNotificationName = NSApplication.didBecomeActiveNotification
fileprivate var DidEnterBackgroundNotificationName = NSApplication.didHideNotification
fileprivate var WillEnterForegroundNotificationName = NSApplication.willUnhideNotification
#else
#elseif canImport(UIKit)
fileprivate var WillResignActiveNotificationName = UIApplication.willResignActiveNotification
fileprivate var DidBecomeActiveNotificationName = UIApplication.didBecomeActiveNotification
fileprivate var DidEnterBackgroundNotificationName = UIApplication.didEnterBackgroundNotification
fileprivate var WillEnterForegroundNotificationName = UIApplication.willEnterForegroundNotification
#endif


extension VideoPlayer {

func addLifecycleObservers() {
Expand Down

0 comments on commit 714267a

Please sign in to comment.