migueldeicaza / SwiftGodot

New Godot bindings for Swift
https://migueldeicaza.github.io/SwiftGodotDocs/tutorials/swiftgodot-tutorials/
MIT License
1.06k stars 64 forks source link

Clean up unnecessary Foundation imports #427

Closed tishin closed 5 months ago

tishin commented 5 months ago

This leaves only 2 imports in SwiftGodot where Foundation is actually used:

Both can be refactored without using Foundation dependency, which is too heavy for non-Darwin platforms compared to the convenience it brings. I think it should be up to users to decide whether they want to include Foundation into their game or not.

migueldeicaza commented 5 months ago

Thank you, I didn’t realize Foundation was the source of this pain.

I don’t mind removing the asData() one for the sake of reducing the dependency. Would love to find a way of making people’s lives easier still for that common idiom.

migueldeicaza commented 5 months ago

I just dropped the asData with the suggestion from above.