RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

FluffyJack — 62 posts

I have a new series I'm working on called RubyMotion for Rails Developers. The intro video and the first episode ("Hello RubyMotion") are up and free to watch to get an intro into using RubyMotion. There will be a new episode released each week. Subscribe for only $9/month to get access to the other 11 as their released.
The big announcement of RubyMotion's support for Android has finally reached public beta! Instead of creating my normal polished screencasts, I decided to got RAWRRRR!!! This is me playing around trying to get RubyMotion for Android set up, and at the end you can see me fighting with the Android emulator, showing exactly why I use a device for development, because it's faster and more stable. It's a bit longer than I would have liked, but if you're wondering about all the stuff you're doing with setting up, this is going to be the goto place to work that out. Eventually I'll update this as things change over time.
This is the second post in a series about getting to know RubyMotion. At the end of the previous post we had something on screen and had learnt some core principles of iOS development with RubyMotion, now we're going to get ourselves organised using classes for a controller and a view, and get some interaction going in the next part of the series, Gaining Control of RubyMotion with UIViewControllers
Starting A RubyMotion Application
Go through the process of creating a real iOS application using Ruby in this ongoing tutorial series. Part one is introducing you to the basics of just getting something on the screen and pointing out some core differences between most Ruby implementations and RubyMotion.
It's happening, we will soon have a new Ruby/Rails weekly screencast! I'm going to be launching in the next 1-3 months depending on how things go, but you can read the full story here:
Should You Learn RubyMotion or Swift?
A look at Swift's future, whether it's worth learning, and comparing and predicting it's potential future, with RubyMotion's past. A great read if you're not sure where to focus your attention.
Blocks can sometimes lead to a mix of concerns when you've got a block bigger than a few lines. There is a way around this though, which I'm going to show you through in this episode.
In the previous episode we looked at CALayer and how easy it makes animating your views. We're going to expand on this by looking at a class I mentioned at the end of that episode called AVPlayerLayer, and it's buddy AVPlayer. Using these classes you can creating custom designed video players and animate them in the same ways that you can animate CALayer (because AVPlayerLayer is a subclass of CALayer), without making the video jump, it's all very smooth.
Working with UIKit and AppKit is common place when you're working with RubyMotion, but sometimes it's good to drop down a layer (or should I say CALayer), and interact with something else. CALayer is a great class to work with, especially when it comes to animating properties, because it does it all automatically for you. Watch this episode and see how to take advantage of this awesome class.
Tonight at SydInMotion I got in a discussion that lead to me explain Dispatch.once and why it’s so handy. I’ve decided to write this up as a quick tip as it’s useful in almost any application.
After popular request, here is a basics episode for using MotionKit with your table cells, including how to use autoresizing masks and the MotionKit DSL for Auto Layout in your table cells. A short episode filled with good tips.
Swift Still Won't Replace RubyMotion
The day Swift came out, I wrote up a piece about “Why Swift Will Never Replace RubyMotion” which ended up getting a good amount of attention, both good and bad (luckily mostly good). Since then though, a lot has happened, I’ve talked to a lot of people about my post, I’ve read other peoples thoughts, and most importantly I’ve read and watched as much as I’ve been able to about Swift and how to use it.
Container controllers, such as UINavigationController or UITabBarController are the core navigation mechanism for many of our applications. The UIKit framework provides us with mechanisms and direction to create our own custom container controllers, which we'll be covering in this episode.
I’ve been seeing a lot of tweets from people saying that Swift has basically killed RubyMotion, which is extremely far from the truth, and I’m going to explain why quickly and without much fuss, because people seem to just be saying it without thinking.

Why Swift Will Never Replace RubyMotion
A Big Week For RubyMotion Developers
This past week has been insane for me, with the RubyMotion #inspect conference, and now the massive announcements from WWDC, there is a lot of new things for us RubyMotion developers. Not only do we have a new platform (Android) to work with soon (which for a lot of you may be the first time you’ve ever touched it), but Apple has dropped some amazing new APIs for us to use, and we haven’t even seen close to all of them yet.

A Big Week For RubyMotion Developers
UIPickerView is a common sight in a lot of applications, it's an easy and familiar way to... well... pick things. Understanding the delegate and data source though can allow you to really understand what's possible and use it in more creative ways.
I have a special episode for you all today! This is a normal episode just like any other, where I'll walk you through the process of using motion-installr to get setup for ad-hoc deployment using the awesome Installr service. The twist is though that I also have a competition for you! Here is the episode and this is the competition details.
This is the source code and slides from a talk I gave at the SydInMotion meetup today where I showed everyone how to keep your use cases and business logic in clean, easy (and fast) to test, plain old ruby objects, and then plug in your delivery mechanisms, database, etc. Give it a look if you're interested.
Waiting for your RubyMotion app to compile before your tests run can be a hinderance to a good TDD cycle, so I decided to come up with a way to test my code using any Ruby test framework without having to compile first.
Writing Gems for Ruby and RubyMotion
I’ve worked out a fairly simple way to make your gems work for normal Ruby projects and RubyMotion projects. This is only a starting point, of course there is more work to be done in larger codebases, but this could let you test your core functionality separate from your delivery platforms so that you know your business logic works.

Writing Gems for Ruby and RubyMotion
MotionKit is the new kid on the block for us RubyMotion developers, providing us with a fantastic new way to handle our screen layouts. In this episode we take a look at some of the basics of creating a layout, adding styling and subviews, and laying them out on the screen using MotionKit's fantastic AutoLayout API.
Over the past few episodes, we've created the Tasker application, which we polished off in Episode 21. Now it's time to share it with our beta-testers. In this episode we explore how to set up your distribution certificates and provisioning profiles, and how to then get both TestFlight and HockeyApp set up to share your application around. This has been a highly requested topic from the RubyMotion community, and so I decided to show you how to use both TestFlight and HockeyApp instead of just one!
For the past 5 episodes, we've been building the Tasker application, and as of episode 20, it's basically ready to go except for a few more tweaks. So in this episode, we're going to clean things up by utilising MIMInputToolbar, TPKeyboardAvoiding, input views and input accessory views. This episode also looks a little into my process for splitting out views into reusable chunks. Many of you use Formotion, but this episode is going to give you a look at how easy it is to build custom forms just by utilising some simple pods and gems.
By using local notifications you can remind your users about your application, notify them with reminders, and use the notifications for all kinds of creative ways of enhancing the user experience and engagement with your application. In this episode we round off the functionality of our Tasker application by implementing local notifications to remind them of due tasks.
Dates are an important part of a lot of applications, and how you display them for their context can make a difference to how quickly users parse the information on screen. In this episode I walk you through getting the MHPrettyDate cocoapod set up in the Tasker application, and show you how to use NSCalendar and NSDateComponents to work with dates properly.
Both AutoLayout and the creation of custom UITableViewCell subclasses is extremely important when doing iOS development, so once you've finished watching this episode, I'd like you to take away the knowledge of "Why is AutoLayout important?", "Why create custom table view cells?", "How AutoLayout works", and finally "How to use AutoLayout when creating custom cells". You're going to learn these things while we take a look at our example RubyMotion application "Tasker", and there is some new parts to MotionInMotion in this episode where I change up the format a little, with a bit more "Why" than just how, as well as a challenge for you at the end to practice your skills.
RestKit is an amazing library for communicating efficiently and easily with RESTful services, like a Rails backend for your application. With a bit of setup, it's by far one of the best ways to keep your RubyMotion app in sync with your server. We're going to continue where we left off in Episode 16 with our Tasker application, and have RestKit keep our tasks saved to the server, and keep the server and Core Data store in sync. See the show notes for the Rails app I'm using with Tasker.
The MotionInMotion RubyMotion pairing sessions are focused on doing one-on-one training with developers who are new to RubyMotion, and recording them so other newcomers can learn from it. In this session we work through an error when working with cocoapods due to Command Line Tools not being setup, and then go through some of the basic concepts of iOS development like views, target-action, table views, and delegates & data sources. If you're not interested in the part at the beginning where we're fixing the error in cocoapods, skip ahead to 22m 20s in.
It's time to learn how to efficiently manage a Core Data backed UITableView by using NSFetchedResultsController. It's much simpler than you would think, and once it's done it's extremely easy to maintain. Your table views will be faster, your memory usage will go down, it's just a great time to be a table view!
C macros are used fairly often in Objective-C projects, but RubyMotion doesn't provide a solution for these. Instead we can preprocess our application's files ourselves before they're compiled, using ruby!
There is a lot of apps out there that have both an iOS and OS X application, and a good amount of their code could be shared. Learn how to do exactly that with RubyMotion by reading my new blog post, Truly "Universal" RubyMotion Apps.
Grand Central Dispatch is one of the greatest (grandest even?) ways to do multithreaded applications in any language, which if you're doing any kind of processing or network communication, it's likely you will need to make your application use multiple threads too. In this episode we take a look at the main use cases for GCD and the simple code you need to write to run certain tasks in another thread by using queues and blocks.
There is more to Todd Werth's RubyMotionQuery (RMQ) than you might realise, it's filled with amazing tools to help you clean up your code and possibly do things you didn't know were possible. In this episode I have 5 Advanced RMQ tips to expand your knowledge of RMQ.
RubyMotion the "Rails" Way Proposal
This is a current proposal that I’d like your feedback on for how we can clean up how we write RubyMotion applications. It’s purely conceptual at the moment, and there would have to be some framework development to make this work the way described here.

Please submit your feedback, as a joint effort we can clean up our RubyMotion applications and make it easier for Rails developers to expand their skills into RubyMotion development.

RubyMotion the "Rails" Way
Earlier today I posted a link to an article on Twitter from The Frontier Group, which was talking about their experiences with RubyMotion, great article, but when I tweeted the link, it sparked some discussions between me and other people, and other groups of people which those discussions then got brought up with me.

Read about my thoughts.
In this week's episode, we take a look at creating custom URL schemes for your application, so that other applications can open it, and how to open another application from your app. We are going to work with two applications, one for asking for authentication, and one to act as an authenticator, similar to how "Connect with Facebook" used to work before it was integrated into iOS.
A problem that many RubyMotion/iOS developers have had to face is when their navigation bars overlap their views. There has been one fix that developers have been using for a while, but in my opinion, it's a bit of a "hack". Instead there is an alternative way of fixing the problem by using a UIScrollView!
Whenever possible, I’ll be doing email (and maybe some video) interviews of people in the RubyMotion community who’ve put something out there in the iOS or OS X App Stores.

Today’s RubyMotion master is Odin Dutton, who created the brilliant Service Status app for iOS.
RMQ is a great gem for giving us a jQuery like tool for doing RubyMotion development. Learn all about it in Episode 11 of MotionInMotion.
I have just released the final part of the four part series about creating OS X applications using RubyMotion! A great starting point for you to step into iOS and OS X programming with Ruby. I'm so happy to say I've had heaps of people say they've found a huge interest in RubyMotion since reading these posts!
Whenever possible, I’ll be doing email (and maybe some video) interviews of people in the RubyMotion community who’ve put something out there in the iOS or OS X App Stores.

Today’s RubyMotion master is Andrew Gertig, who created the brilliant Mutual app for iOS.
Build an OS X app in Ruby: Part 3
In parts one and two we got our application up to the point where the UI was sending us information through the terminal, but now in part 3 we're going to setup our model and get the controller to keep the UI in sync!

Read it now, doing all 3 parts will take less than 30 minutes!
In the past few episodes we’ve been taking a look at some of the gems available to make your development faster, your code cleaner and more ruby like, as well as generally make you a happier developer. The series continues with this episode where I’m going to show you how to convert an existing view to use Teacup instead. I wanted to show you something a bit more complicated than the Zaggstar app we’ve been looking at in the previous two episodes, so we’re going to be taking a look at Blapp again, the application from the CDQ episode. We’ll be converting the detail view for a post to use Teacup’s DSL instead, and to finish off, we’re going to improve things by using Teacup’s constraint helpers to setup AutoLayout.
Many of you have probably been considering getting into building iOS and OS X apps, but now I'm going to make it really easy for you. Pre-orders are now open for my new book RubyMotion for Rails Developers, and you can choose what you pay!
I've just put out a new episode of MotionInMotion, where I continue on from the last episode to show you how to do add, edit, and delete interactions in a RubyMotion application. If you haven't already, watch episode 8 first, then continue on in episode 9 about integrating ProMotion and Formotion.
OS X Apps with Ruby: Part 2
The next post in the series about developing OS X apps with RubyMotion! If you don't have a RubyMotion license, go get one, it comes with a 30 day money back guarantee anyway, then come back and read this and start your learning! OS X Apps with Ruby: Part 2
Sometimes you need to build something really quick, just to get an idea across. RubyMotion is fantastic for building iOS and OS X apps quickly, but with the help of gems like ProMotion, you can work twice as fast! That's why we're going to take a look at ProMotion. This will be the first in a series of episodes about the gems you have at your disposal and how you can use them all together to write beautiful code, quicker than usual.

Watch the episode now!
New series I'll be releasing through my blog on building OS X apps with RubyMotion. For anyone that was reading the MVC/Cocoa intro posts, I'll still be doing those too! Here is part 1 for building OS X apps using Ruby.

It will seriously take you 15 minutes to do this part, just give it a go, and start learning how to do OS X development with Ruby.

Make sure you subscribe to my RSS which you can click on just above the author bio at the bottom of the page, so you can follow along with the series easier.
It's been about 3 weeks since the RubyMotion community project group started, and I wanted to do a bit of a write up about how things are going, and why anyone interested in RubyMotion should join us.

I've also written a small part about discrimination and the importance of embracing differences.
Episode 7 of MotionInMotion just came out, where you're shown how to make an app called KeyHook, that lets you use the camera on your iPhone to remember where you left your keys, all in Ruby! It's a simple episode, and easy to follow along. Create a RubyMotion app and show it off to your friends.
I've posted part 3 in the ongoing series trying to educate Rails, Sinatra, and other kinds of web developers, about the world of iOS and OSX development with RubyMotion.

This part is called "Your Views Have Come To Life" and talks about how your dreams come true when working with RubyMotion.

Your views are objects of their own right, and have an entire life and mind of their own that you, as their creator, can control!
Yesterday I put out an article explaining Apple's MVC pattern in a way Rails developers could understand, and it got a crazy amount of traffic, well for my standards 600 views in 24 hours seemed impressive for a fairly new blog.

Today I've written the second article in the ongoing series of explaining RubyMotion to Rails developers called "ERB vs UIView - Requesting Data", where I'll explain how similar views and html/erb really are, and the fact the only main difference is how the content gets in there.

Help others understand by sharing the article on twitter, and subscribe to the RSS feed (just above the author bio) to be updated when new articles in the series come out.

Also if you're interested in RubyMotion, I run the weekly screencast for RubyMotion called MotionInMotion. It's only $9/month and you'll get a new episode every week.
Episode 6 has just been released for MotionInMotion.

If CoreData is overkill for your application, you might be able to just write data out to the disk, or store it in NSUserDefaults. I'm going to show you how to do this in RubyMotion, and teach you how to encode and decode data which will help with storing any kind of data, not just your models.
An explanation of Apple's MVC pattern, and namely where controllers sit in the larger scheme of things. I compare an iOS button tap and a Rails request side by side and show you how similar they actually are.
As one of my subscribers pointed out, the shock for a rails developer trying to learn the RubyMotion (well iOS/OS X) MVC design patterns is, for some, immense. There is a lot of content starting to help though, and I've decided to share mine too. I made Episode 2 of MotionInMotion a free episode. It's about Delegates and Data Sources, and shows you how different things can be, in a simple way that makes the transition easier. Go check it out, it's free now, no risk, go learn:
The Amazing Power of NSCoding
If you're into RubyMotion, read this, learn the secret ways and amazing powers of the NSCoding protocol!
If you're using RubyMotion (or even if you're thinking of using it), read these 5 tips to improve how you organise your app's code.
Episode 5 of MotionInMotion is out, and it's all about how easy working with CoreData is when you use RubyMotion, CDQ, and ruby-xcdm.
I'm trying to organise an initiative where a bunch of members from the RubyMotion community get together and build some iOS and OSX apps as a group. I've written a blog post to detail what I'm talking about: Building Apps as a Community
RubyMotion Community Members
I wrote a quick blog post to mention some of the big names in the RubyMotion community! If you're into RubyMotion, you need to be following these guys on Twitter.
I just launched MotionInMotion a few days ago. RubyMotion screencasts so you can write awesome iOS and OSX apps with Ruby! Use the coupon LAUNCH20 before 06/01/2014 to get 20% off your subscription forever!
RubyMotion Testing Tools
Wrote up a quick blog post about the tools RubyMotion developers have available for testing.

RubyMotion Testing Tools