40% faster

First, as you noticed there was no Dispatch last week. It was a holiday in the US this weekend and I was traveling. I was also waiting for the new update of RubyMotion to be released. So don’t worry, the Dispatch is alive, kicking, and going strong.

Speaking of the update to RubyMotion, it’s a cool one. While you’re focusing on all the iOS 8 stuff don’t miss that last line, the one that says that startup time is 40% faster. That’s huge.

Please let me know if you have measured your apps starting 40% faster.


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

Happy coding, Todd Werth (@twerth)

Articles, News, New Gems, and Blog Posts


September 1st, 2014 | screencast | by Jack Watson-Hamblin
MotionInMotion – Episode 40 – Interface Builder and the IB Gem

August 29th, 2014 | video | by Jack Watson-Hamblin
Taylor Luk from Issue.by talking about Hybrid Apps at SydInMotion – Sydney RubyMotion Meetup

August 28th, 2014 | examples | by Mark Villacampa
Showcases the use of extension and framework targets in iOS

August 28th, 2014 | blog post | by Matt Brewer
Introducing ProMotion-menu

August 25th, 2014 | screencast | by Jack Watson-Hamblin
MotionInMotion – Episode 39 – Publish and Subscribe with NSNotificationCenter

August 22th, 2014 | blog post | by Will Raxworthy
Chromecasting with RubyMotion

August 11th, 2014 | new pod | by Imanol Fernandez
MGSwipeTableCell – An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions

RubyMotion Job of the Week


RubyMotion iOS Engineer at Jukely in New York City

Jukely is a matchmaker for concerts and friends. We match live music lovers with concerts and friends to go, with based on their collective music tastes. This gets people go out to more shows.

We are looking for a RubyMotion iOS Engineer to join our team in New York City. The candidate will work on the Jukely iOS app that’s been selected by Apple as Best New App. It’s also been included in Apple’s WWDC sessions for good design and user experience. Read more.

RubyMotion App of the Week


image

Songdrop – “Listen to music from YouTube, Soundcloud, Bandcamp and Vimeo all in one place for free! Find songs and add them to your mixes: you can create playlists with videos and songs, then share them with your friends.”

Gems used:

  • bubble-wrap
  • sugarcube
  • motion-cocoapods
  • motion-testflight
  • motion-layout
  • songdrop

Pods used:

  • MBProgressHUD
  • ZKRevealingTableViewCell
  • Facebook-iOS-SDK
  • OHAttributedLabel
  • NewRelicAgent
  • TestFlightSDK

RubyMotion News


RubyMotion 2.32 update

  • The iOS 8.0 and OS X 10.10 versions of the runtime have been recompiled
    with Xcode 6 Beta 6.
  • [iOS] Depracted rake options device_family' andretina’ in favor of
    device_name' which takes the name of one of the configured device-sets
    found in Xcode -> Window -> Devices or the
    simctl’ tool (its location can
    be found in the message shown when using one of the deprecated options).
  • [iOS] Added support for iOS 8 App Extensions. See the motion create --help'
    output for a list of available templates and configure your host application
    with the following:
    app.target(“path/to/extension”, :extension)’.
  • [iOS] Added support for frameworks that allow you to share code between your
    host application and its extensions. Use the ios-framework' template formotion create’ and configure your host application with the following:
    `app.target(“path/to/framework”, :framework)’.
  • [iOS] Fixed a bug where backtraces could not be symbolicated on the iOS 8
    Simulator.
  • [iOS] Fixed a bug where the iOS 8 Simulator could not be launched with the
    default device config.
  • [iOS] Fixed a bug where the iOS 8 Simulator could not be used to select
    views in the REPL.
  • [iOS] Fixed a bug where the REPL view selection would incorrectly invert the
    coordinates for the landscape orientation on iOS 8.
  • [iOS] Fixed a bug where “xcodebuild: error:” message would be displayed
    when it will configure `app.xcode_dir’ for Xcode6 path.
  • [iOS] Fixed a bug where Instruments.app does not launch with `rake profile’
    on iOS 8.
  • [iOS] Fixed a bug where iPhone 4s / iOS 7' simulator was always launched
    if Xcode 6 location path was specified through
    app.xcode_dir’.
  • [iOS] Fixed a bug in iOS 8 where Hash objects could not be passed as an
    object of an NSUserDefaults.
  • [iOS] Added `app.embedded_frameworks’ configuration to support dynamic
    framework on iOS 8.
  • Fixed a bug where headers in nested symlinked directories could not be used
    with `vendor_project’ and an Xcode project.
  • Fixed a regression where a crash would happen when calling user defined
    method if the same method was already defined in some classes in Apple SDK.
  • Fixed a regression where a crash would happen when calling methods after
    used a method with variadic arguments.
  • Fixed a bug where a “not precompiled” error would happen when calling the
    SKPhysicsWorld method which takes with Objective-C Blocks.
  • Fixed a bug which superclass method would be called if method was removed
    through Module#remove_method.
  • Fixed a bug which it would trigger crash when the method for KVO was called.
  • Fixed a bug where overrode Time#+ would not be called.
  • Fixed a bug which it would trigger random crash when #method_missing will be
    called.
  • Fixed a bug where it would cause a “Permission denied” error if vendor
    library directory was not writable.
  • Improved Module#define_method performance. ~3 times faster.
  • Improved Object#method_missing performance. ~8 times faster.
  • Reduced the app boot time. ~40% faster.
sudo motion update

Hidden Gem by Gant Laborde


Here’s a classic: Most of you know, you can build an array of default values.

Array.new(5, false)
#=> [false, false, false, false, false]

The second argument populates with references to a single object (WOW Such speed!). But that means if we pass a mutable object, like a hash, we’re not going to get the desired effect.

This can be easily demonstrated with the following: Array.new(5, rand(10)) which lands us something like [2, 2, 2, 2, 2] ewwwwwww.

Just use the proc to the array for mutabel objects. A Hash.new would work fine from our proc. Using our previous example, you can see results are probably more to your liking:

Array.new(5) { rand(10) }
#=> [1, 9, 4, 3, 9]

RMQ Tip of the Week


Tables and collections

People ask me a lot about how to do a UITableViewController or UICollectionViewController in RMQ. The simplest answer is to have RMQ create one for you and look at what is produced. It generates the current best practice for each.

In your command-line do:

rmq create collection_view_controller foo
rmq create table_view_controller bar

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


Don’t miss next Tuesday’s announcement by Apple. I hope there are some new things that we can build apps for: iWatch, larger iPhones, etc.


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