Swift is not Ruby, Ruby is not Swift

There has been a lot of hubbub surrounding the introduction of the Swift programming language by Apple.

I find it interesting that many people feel that Swift is the death of RubyMotion, Xamarin, etc. It’s a strange reaction and a bit perplexing to me. Perhaps it’s something about the Apple developer community because they’ve been, basically, mono-language for so long, they assume that it’s normal.

Windows is written in C++, but you can write native Windows apps in many different programming languages. Unix is written in C, but I can happily program in C++, Fortran, Pascal, Lisp, etc.

In OS X, for native apps, you can now choose from Objective-C, Swift, RubyMotion, Xamarin/c#, c++, etc. This seems good, normal, and healthy.

I like Swift, but it’s less like Ruby and more like Scala. I personally prefer dynamic languages over statically-typed languages (I think static typing is premature optimization). I work in Vim, and prefer the command-line dev environment. So Swift isn’t for me, and Ruby isn’t for someone else. Mono-cultures tend to die. RubyMotion isn’t going to die, iOS isn’t going to die. That’s a good thing.


If you missed the last issue, you can find it here: issue #30.

Happy coding, Todd Werth (@twerth)

Articles, News, New Gems, and Blog Posts


June 12th, 2014 | meetup | by okcruby
Oklahoma City – June 2014 Meeting

June 9th, 2014 | screencast | by Jack Watson-Hamblin
Episode 28 – Setup Wizards and Custom Container Controllers

June 9th, 2014 | blog post | by Philipp Fehre
Using CouchbaseLite from RubyMotion

June 9th, 2014 | blog post | by Landon Schropp
Let’s Write a RubyMotion App: Part 2

June 9th, 2014 | example app | by Gant Laborde
RMQ Animations – Example of using RMQ’s canned animations

June 7th, 2014 | gem | by Shizuo Fujita (Watson)
motion-parallel – provides parallel iterations for RubyMotion

June 6th, 2014 | blog post | by Colin T.A. Gray
My Xcode Argument

June 6th, 2014 | slides | by Mark Villacampa
Inspect 2014 talk – Connecting RubyMotion with Hardware – Rubymotion

June 5th, 2014 | gem | by Gavin Morrice
motion-persistable – Persistable attributes for Rubymotion classes

June 4th, 2014 | example app | by Torben Toepper
An implementation of Flappy Bird in RubyMotion for iOS.

June 1st, 2014 | blog post | by Michal Taszycki
Universal Ruby Gems in 20 Lines of Code

RubyMotion News


RubyMotion 2.29

  • Added support for Xcode 6 Beta 1 and iOS 8.0 / OS X Yosemite (10.10).
  • Fixed a bug where objects removed by Array#delete would not released.
  • Fixed a bug where a `not precompiled’ error would happen when calling an alias to an Objective-C method with a C-level block argument.
sudo motion update

RubyMotion Tip of the Week


From the archive:

zPosition and z index

This is very confusing, especially if you come from the web world. There are two ways to change the z dimension:

zPosition: The zPosition only affects the UIView visually, it does not affect its actual order. Its z-order depends on its place in its parent’s subview array. In other words, the order you create the subviews is the z-order. To change the zPosition:

my_view.layer.zPosition = 10
In a rmq stylesheet or style block:
st.z_position = 10

z index: The order that the subview was added to its superview (addSubview, insertSubview, etc. Or in rmq: rmq.append, rmq.prepend, rmq.unshift, etc). You can change the z index by moving the view arround in the array, here are some methods for that:

my_view.bringSubviewToFront
my_view.sendSubviewToBack

Wat!


Feel free to chime in: Qoura – “Will the introduction of Swift inhibit RubyMotion’s entrance into the iOS development world?


If you have any tips, blog posts, or want to sponsor this newsletter, please send emails to todd@infinitered.com