February 02, 2019
Check the code
I tried Swift for last two months and found that amount of ready to use solutions in Swift package managers is smaller than in npm.
npm has a lot of packages that can be used for free and easy to install. Swift is a powerful and intuitive programming language that can be run on both Apple’s devices and Linux.
I just want to make import a little bit easier.
This solution would look like this:
Yeah, look nice.
But it would be good to have some sort of
require to fast import and use.
Like this one:
// here `arr-diff` will return difference between two passed arrays let arrDiff = import(“arr-diff”) let diff = arrDiff([1, 2], [2, 3]) // diff will hold array of difference and will be equal to `[1, 3]`
What we can have right now?
import JS code.
We need a simple working bridge.
import will work only for one file package but it can be improved in future.
See more examples here
What’s the future roadmap?
In future we will have:
importthat we need.
importthat will allow us to call methods from npm package. And give ability to import any package from npm
It was interesting to me to dive into the Swift world. I plan to learn more and share with you.
Please leave feedback on:
Thanks, Max for code review and inspiration
Personal blog by me