From a8c2e2986838dccbcc4bd218b501f0bf86b36e2c Mon Sep 17 00:00:00 2001 From: der richter Date: Sat, 20 Jul 2019 12:16:37 +0200 Subject: cocoa-cb: migrate to swift 5 with swift 4 fallback this migrates our current swift code to version 5 and 4. building is support from 10.12.6 and xcode 9.1 onwards. dynamic linking is the new default, since Apple removed static libs from their new toolchains and it's the recommended way. additionally the found macOS SDK version is printed since it's an important information for finding possible errors now. Fixes #6470 --- osdep/macOS_swift_extensions.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'osdep/macOS_swift_extensions.swift') diff --git a/osdep/macOS_swift_extensions.swift b/osdep/macOS_swift_extensions.swift index 7929d48f9a..1e30cf4df7 100644 --- a/osdep/macOS_swift_extensions.swift +++ b/osdep/macOS_swift_extensions.swift @@ -17,11 +17,15 @@ import Cocoa +extension NSDeviceDescriptionKey { + static let screenNumber = NSDeviceDescriptionKey("NSScreenNumber") +} + extension NSScreen { public var displayID: CGDirectDisplayID { get { - return deviceDescription["NSScreenNumber"] as? CGDirectDisplayID ?? 0 + return deviceDescription[.screenNumber] as? CGDirectDisplayID ?? 0 } } -- cgit v1.2.3