5 ms·
I usually use bash or ruby to do scripting, but I think is a good idea to use the power of Swift to this task.
by marvel_boy 11y ago
I usually use bash or ruby to do scripting, but I think is a good idea to use the power of Swift to this task.
- timanglade 11y agoYeah, I’m actually surprised Apple hasn’t made a play for this from day 1 since developing iOS/OS X often leads to writing/maintaining a bunch of home-made or 3rd-party scripts (usually in Ruby), making app development require not only knowing Objective-C & Cocoa but also some scripting language. After all if Swift is all about making it easier for more people to build apps more easily, this seems like a worthwhile use-case to go after.
- coldtea 11y ago>Yeah, I’m actually surprised Apple hasn’t made a play for this from day 1 since developing iOS/OS X often leads to writing/maintaining a bunch of home-made or 3rd-party scripts (usually in Ruby), making app development require not only knowing Objective-C & Cocoa but also some scripting language. Define "often". Besides, Swift wasn't even that ready for application develoment from day 1.
- timanglade 11y agoI actually can’t recall the last time I looked at an iOS app that didn’t use a build script, Rakefile or Cocoapods/Carthage (the latter of which is mostly written in Swift, it should be noted). It’s true that Apple has to prioritize though!
- zw 11y agoThe Swift standard library is not yet up to snuff for that, you still need to know Cocoa to do basically anything high-level. Thankfully I know Foundation better than I do straight-up POSIX, so that's tenable for me, but it's not for most people who want something script-y.
- tempodox 11y agoNot only that, but you also need to know the hocus pocus to bridge between (Obj)C and Swift. And let's not forget that the Cocoa header files are browsable, thus enabling “discoverability”, while Swift is completely obscure in that respect.
- seivan 11y agoI recently used someones template tool to generate some methods in Swift but with some erb-like syntax to actual Swift code. It was actually more pleasant than I thought, and I usually use Ruby for this. Might do this more often in the future. But Ruby still has the benefit with gem install that can get you anything from a twitter client to an IRC-bot lib.