DataCache icon indicating copy to clipboard operation
DataCache copied to clipboard

Add macOS support.

Open RyPoints opened this issue 4 years ago • 3 comments

Already works. Already been using it. Just needs to be added to the podspec.

RyPoints avatar Nov 22 '21 01:11 RyPoints

Ah, looks like because of updates with UIImage/NSImage you also need the changes here: https://github.com/RyPoints/DataCache/commit/be9836986e337977947b5a9fe6c35a7968ac697c

You could just #ifdef a little in DataCache.swift and support macOS though.

RyPoints avatar Nov 22 '21 02:11 RyPoints

But you have changed the code to Cocoa and NSImage, it won't work on iOS anymore, will it?

huynguyencong avatar Nov 22 '21 03:11 huynguyencong

Yeah, it won't like that. That's just for me on macOS. You can easily support both though via wrapping my code and using:

#if os(OSX)
    import Cocoa
#elseif os(iOS)
    import UIKit
#endif

RyPoints avatar Nov 22 '21 04:11 RyPoints

This supports macOS but doesn't support iOS. I will close it.

huynguyencong avatar Dec 12 '22 10:12 huynguyencong