Open Khalian opened 7 years ago
I believe our iOS framework should already come with both Foundation and UI Extensions. I don't think our iOS users should have to install both EZSwiftExtensions-UI and EZSwiftExtensions-Foundation directories separately.
This issue was brought up about a year ago too. It wasn't ready at that time and there weren't enough non-Apple related uses of Swift back then. But times are changing.
I think instead of making 2 separate directories which will confuse the user, we could just add if cases and only compile the code the user can compile?
Like: #if os(iOS)
Also version compatibility is another similar issue. Ideally the user should be able to use the latest version of EZSwift even if they have a different version of Swift. This can be achieved by adding checks like: #if swift(>=3.0)
everywhere.
I agree with everything but the last paragraph. I think it will look like a shitshow with those #if swift(>=3.0)
everywhere....
Ok then should I go ahead and add #if os(iOS) on all UIKit classes (its a little concerning for me to make it architecture specific instead of separating the concerns into different folders).
Yeah, go ahead. But before check if there is an easier way of doing it, there just might be.
Thanks guys, this will be helpful. For my MacOS and Linux apps I've had to copy code into my project that could be based on Foundation rather than UIKit. I'll much prefer being able to use the code without having to modify it.
I am prioritizing this and started the ball rolling in : https://github.com/goktugyil/EZSwiftExtensions/pull/431
MacOSx support is complete as of https://github.com/goktugyil/EZSwiftExtensions/commit/e26ca720032dc5232ea655c21eb10ad877a10971. I will begin work on WatchOS when I get the free time.
Thanks @Khalian. You did an awesome job
So I have always thought of EZSwiftExtensions as a standard library (kind of like Apache Commons).
Standard libraries of languages have the characteristic of being cross platform. So as a consequence I decided to investigate the feasibility of cross platform support.
I tried spinning up a docker container using https://github.com/swiftdocker/docker-swift. After that I tried https://swift.org/package-manager/ to bundle the module in linux. I was able to get the foundation code to work but not the IOS specific code - (UIKit).
This issue is a discussion if we want to pursue cross platform support and a plan for the same.