2015

Happy New Year. This is going to be a great year for RubyMotion. Android was finally released, the Apple Watch is coming, and much more.

For those new to the RubyMotion community, every year there is the #inspect conference for RubyMotion. The date hasn’t been announced this year, but last year it was in May so that’s a good guess.

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

Happy coding, Todd Werth (@twerth)

Articles, News, New Gems, and Blog Posts


new gem | by Vladimir Keleshev
motion-set – Set implementation for RubyMotion

January 6th, 2015 | screencast | by Jack Watson-Hamblin
MotionInMotion – RubyMotion for Rails Developers: Table Views (part 2) – Cell Styles

January 3rd, 2015 | new gem | by Shizuo Fujita (Watson)
motion-appstore – A RubyMotion plugin to provide ‘validate’ and ‘upload’ commands for iTunes Connect.

December 30th, 2014 | screencast | by Jack Watson-Hamblin
MotionInMotion – RubyMotion for Rails Developers: Table Views (part 1)

December 25th, 2014 | new gem | by Ramon Huidobro
locamotion – Helper tool for localizing Ruby motion apps

December 23rd, 2014 | screencast | by Jack Watson-Hamblin
RubyMotion for Rails Developers: MotionKit (part 2)

December 23rd, 2014 | new gem | by Gant Laborde
newclear – newclear gives you a new and clear run of your build

December 22nd, 2014 | blog post | by Will Raxworthy
RubyMotion Android Install Guide

December 19th, 2014 | blog post | by Mirko Stocker
RubyMotion 3 Release Supports Android and WatchKit

December 19th, 2014 | blog post | by Elliott Draper
Customise a Mac OS X window further with RubyMotion and MotionKit

December 16th, 2014 | blog post | by Todd Werth
After a year and a half, 21 releases, 554 commits by 23 contributors, 1708 requirements in specs, RMQ is finally at 1.0.0.

December 15th, 2014 | screencast | by Jack Watson-Hamblin
RubyMotion for Rails Developers: MotionKit (part 1)

December 13th, 2014 | example | by Eloy Durán
BitWatch – This application is a ported version of the application that you build when following this excellent WatchKit tutorial

December 10th, 2014 | blog post | by Tyrone
Swift Performance: Too Slow for Production

December 8th, 2014 | screencast | by Jack Watson-Hamblin
MotionInMotion – RubyMotion for Rails Developers: Auto-Layout (part 3)

December 5th, 2014 | blog post | by Jamon Holmgren
ProMotion 2.2.0 Released

RubyMotion News


RubyMotion 3.2 released

iOS

  • [iOS] Fixed a bug where RubyMotion frameworks could not be loaded due to required RubyMotion symbols being stripped from application/extension.
  • [iOS] Pick-up new certificates prefixed with iOS instead of iPhone.
  • [iOS] Fixed a bug where WatchKit applications did not honor xcode_dir.
  • [iOS] Fixed a bug where it couldn’t debug with rake device debug=1 on device. Now, debugging only support armv7 in app.archs['iPhoneOS']. (i.e. app.archs[‘iPhoneOS’] = [‘armv7’])
  • [iOS] Fixed a bug where it could not deploy app to iOS 8.2 beta 3 device.
  • [iOS] Fixed a bug where it could not deploy app which contained Watch app.
  • [OSX] Fixed a bug where NSString#initWithXXX would trigger a crash by double free.
  • [iOS, OSX] Fixed a bug where the view object wouldn’t be released when it was created by #init(arg) and super() method.
  • [iOS, OSX] Fixed a bug where nil.isEqual(nil) would not return true. was created by #init(arg) and super() method.
  • [iOS, OSX] Fixed a memory leak when invoking blocks with Dispatch::Queue.
  • [iOS, OSX] Fixed a bug where Marshal.dump would trigger a crash.

Android

  • [Android] Added Bignum#{+@,-@,%,modulo,&,|,^,~,<<,>>,<,<=,>,>=,<=>,abs, to_i,to_int,to_f}.
  • [Android] Added Time#{to_s, to_i, inspect, <, <=, >, >=, <=>, ==, !=} and Time.at.
  • [Android] Improved Fixnum#{%, <=>, &, |, ^, <<, >>} to take a Bignum in argument.
  • [Android] Fixed a bug where gen_bridge_metadata would not detect classes that implement interfaces.
  • [Android] Fixed a bug where gen_bridge_metadata would not work if the user had java 8.0 installed (javap was emitting unrecognized syntax). Thanks to “Theo” for the detective work and the patch.
  • [Android] Fixed a bug where gen_bridge_metadata would emit template information in class/interface names, which would then break the compiler.
  • [Android] Fixed a bug where gen_bridge_metadata would fail to emit proper list of methods for a class that had a static initializer.
  • [Android] Added the :native parameter for app.vendor_project which can be used to specify a 3rd-party shared library to include in the app. Thanks to René Köcher for the patch.
  • [Android] Fixed the extra-packages argument to work with multiple packages. Thanks to Tom Carey for the patch (pull request #185).

RubyMotion 3.1 released

iOS

  • [iOS] Fixed an API validation error when submitting an application that contains an extension.
  • [iOS] Fixed a regression that made it impossible to set environment variables from a host application and propagate them to extensions.
  • [iOS] Fixed a regression that made extensions crash at startup.
  • [iOS] Fixed a regression where a Info.plist file would be generated with wrong details for Background Fetch.
  • [iOS] Fixed a bug where rake background_fetch=1 for background fetch would not work with Xcode 6.x.

Android

  • [Android] Added Fixnum#{~,&,|,^,<<,>>,+@,integer?,odd?,even?}.
  • [Android] Added Float#+@.
  • [Android] Added Bignum#integer?.
  • [Android] Fixed Fixnum#times to return an Enumerator when no block is given.

sudo motion update

Hidden Gem by Gant Laborde


Checking iOS Versions

Many of you who began a project with iOS7 might be feeling that odd stretch between iOS versions now. When iOS jumped from 6 to 7, there was a clear visual change. This change from 7 to 8 feels a bit sneaky in comparison. Fortunately, warnings help direct us along the way. We can always check the version with any of the following:

#Native
UIDevice.currentDevice.systemVersion
#BubbleWrap
Device.ios_version
#RMQ
rmq.device.ios_version

Recently an application I was working on needed to ask for new iOS8 permissions; I wanted to support both iOS7 and 8+. My original iOS7 code was simply:

UIApplication.sharedApplication.registerForRemoteNotificationTypes(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)

RMQ 0.9 supports a great way to make sure you’re on iOS8 with

rmq.device.is_version? “8”

This will return true for 8.0, and even 8.1 etc. But what happens when iOS9.0 comes out? I’d like it to run properly. That’s when it’s great to use rmq.device.ios_at_least? 8 which will return true when 9.0 and even 9.1 etc are released.

So with a simple check, I can now run iOS8+ requests! The code got a bit thicker, but it’s still clear. If any of you are using badges in your iOS7 applications, I hope the following helps!

# need to ask for iOS versions 8+
if rmq.device.ios_at_least? 8 # as of RMQ Edge 12/9/14
  if UIApplication.sharedApplication.respondsToSelector(‘registerUserNotificationSettings:’)
    UIApplication.sharedApplication.registerUserNotificationSettings(UIUserNotificationSettings.settingsForTypes(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound, categories: nil))
    UIApplication.sharedApplication.registerForRemoteNotifications
  else
    UIApplication.sharedApplication.registerForRemoteNotificationTypes(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)
  end
else
  UIApplication.sharedApplication.registerForRemoteNotificationTypes(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)
end

App of the week


image

Mobile Cerebro – by Darren Rogan – “Simple Travel Logging via GPS”

Gems:

  • ProMotion
  • ProMotion-map
  • formotion
  • ProMotion-formotion
  • bcrypt-ruby
  • motion-testflight
  • cdq
  • motion-csv
  • motion-cocoapods
  • bubble-wrap

Pods:

  • MMDrawerController

During Development:

  • motion-reveal – Developer says “Nice editor for playing with the gui while the app is live (changing styling on fly)”
  • LookbackSafe” – Developer says “Does screen recording (records the app and the person using it, handy for testing)”

Sponsor


My company InfiniteRed sponsors this newsletter by allowing me the time to work on it every week and hosting everything.

Contact us if you ever need help working on a project, mentoring, or other development services . We specialize in RubyMotion and have an awesome team.

image

One more thing


WatchKit.gif


If you have any tips, blog posts, or comments, please send emails to todd@infinitered.com