Skip to content

Instantly share code, notes, and snippets.

View StarPlayrX's full-sized avatar
👨‍🚀
iOS tvOS macOS Software Engineer

Todd Bruss StarPlayrX

👨‍🚀
iOS tvOS macOS Software Engineer
View GitHub Profile
@StarPlayrX
StarPlayrX / CrossPlatformImages.swift
Created August 5, 2019 00:48 — forked from JohnSundell/CrossPlatformImages.swift
An easy way to make code that uses UIImage cross-platform between iOS/tvOS & macOS
// Either put this in a separate file that you only include in your macOS target
// or wrap the code in #if os(macOS) / #endif
import Cocoa
// Step 1: Typealias UIImage to NSImage
typealias UIImage = NSImage
// Step 2: You might want to add these APIs that UIImage has but NSImage doesn't.
extension NSImage {