huynguyencong / DataCache

Simple disk and memory cache for iOS
MIT License
101 stars 20 forks source link

Add macOS support. #21

Closed RyPoints closed 1 year ago

RyPoints commented 2 years ago

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

RyPoints commented 2 years ago

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.

huynguyencong commented 2 years ago

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

RyPoints commented 2 years ago

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
huynguyencong commented 1 year ago

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