I’m Teaching a Half Day iOS Refactoring Workshop in July

When I re-entered the self-employed world last March and launched Zorn Labs LLC one of my main goals was to find a way to continue my education work. The first output of this effort has been workshops, specifically one on Refactoring iOS.

I’ve developed and taught the workshop for a local development studio Tonic Design and am now going to run it publicly.

iOS Refactoring Workshop

Throwing away bad code and writing something new from scratch is both risky and expensive. You need to avoid this temptation and instead learn to master small improvements over time.

Refactoring is the art of improving code without changing user behavior. Adding dedicated refactoring time to your workflow and sprints can pay for itself many times over in both added source code flexibility and application stability.

In this workshop we will review refactoring concepts from a high level and then explore example cases found in many iOS projects. As a group we’ll refactor and discuss the benefits of our changes. We’ll then work on our own (or in pairs) to execute what we’ve learned and then demonstrate the results for the class.

This workshop is targeted at those iOS developers who are getting over the hump of learning iOS and now want to know how to write higher quality iOS code. This workshop is capped at 12 people to make sure there is plenty of time for questions and individual attention.

Tickets for the half day workshop cost $189.00 even (we take care of all the ticketing fees). For more information on the agenda, see the event page.

Local performances of this workshop (and others in development) are available for corporate purchase. Contact us for more information.

Pre-“Hello Again” Mac Event Thoughts

Having been a long time Mac user and developer it’s been very disappointing to see Apple ignore the hardware release cycle of the Mac platform over the last few years. I’m really anxious to see what’s going to come of the “Hello Again” event this week and I might even buy a new Mac depending.

Current Mac-state of Mind

So my main personal machine is a 2011 maxed-out iMac. I bought it after waiting and waiting for a proper Mac Pro update in 2011 that was never to come. Overall I’ve been pretty happy with the iMac. I have had to do a USB storage dance with some backups and media drives but overall it’s been a workhorse, with tons of days of Xcode and Warcraft under its belt.

Other Macs in my arsenal include:

  • A 2011 Mac mini which at times has served as a CI box but as of now is dormant (might be resurrected depending how CI plans turn out for my side project).
  • A 2012 Macbook Air which I use situationally. Recently for beta testing 10.12 over the summer and the occasional Philly CocoaHeads video capture.
  • My work provides me a high end Mid 2014 15-inch Macbook Pro. I’m trying to do a better job of keeping that machine in kind of a white room state just for work stuff with mixed success.

I also have a 27-inch Thunderbolt display and a 27-inch Dell display which I use to extend my Macs in various ways at different times.

To Upgrade or Not?

Technically speaking my 2011 iMac is working fine. It does have some issues: occasionally the wifi likes to disconnect, there are some color issues spreading out from the lower left corner of the display, the DVD drive broke (I bought an external one to supplement the occasional need) and the 256 GB SSD is not large enough to hold all my stuff anymore so I have an awkward HD layout with USB storage. The iMac also runs very hot. I suspect part of this is dust build up but have not investigated too much. While annoying, none of these issues are blockers.

The first big upgrade question is laptop or desktop? I’ve always leaned on the desktop experience for pure power but there are many things that push me towards a laptop as my main personal machine right now:

  • I could setup a very “swap” friendly environment that would allow me to have a home work station letting me plug in my personal or work laptop as needed.
  • Since I have a Gaming PC now I don’t need the graphic power of the Mac as much making laptop more feasible.
  • I am traveling more — more conferences, more work trips, single days at IndyHall (instead of a full time desk and me leaving the iMac there). A personal laptop for these days would help me with that home/work separation on the company laptop.

Other welcome improvements:

  • Retina Display. My iMac does not have a retina display and my hope would be that a new laptop from Apple would support this natively as well as support a future retina external monitor connection.
  • More SSD storage. Would be nice to consolidate my external drives into one big SSD.
  • If I go laptop, no need to upgrade two machines every year with a new OS, keeps all the software/licenses in sync.
  • Complier speed improvements. From a numbers perspective my iMac has a good CPU but I would hope improvements to the bus speeds and other architecture improvements would see some improved Xcode complier times.

I feel like in the process of writing this I’ve talked myself into a upgrade but we’ll see what comes out of Apple on Thursday. Enjoy the show.

The World Needs a Better Core Data

Lots of WWDC predictions out there this week. Here’s a dream of mine. Sadly one that I’ve given up on, at least from Apple.

A Better Core Data.

  • Tracking state is 1970s thinking. We should be tracking changes over time and rendering the current state of the object graph.
  • Migrations, the number one feature. As you add new entities to a store, you do so through a migration. Change a column name, you do it through a migration. The current Core Data migration story is embarrassingly complex and very fragile. We need to have trust in our migrations.
  • A single, focused, persistent store format. Allowing people to choose between XML, Binary, SQLite, InMemory and Custom adds more pain than it solves. Keep things simple. One on-disk format.

Clash of the Coders: Day 0

One of the many interesting benefits I get working for Big Nerd Ranch is the opportunity to participate in many fun and unique events. One of the bigger ones is called Clash of the Coders.

Clash of the Coders is an annual coding competition, whereby Big Nerd Ranch effectively “shuts down” for a a few days to allow developers to flex their coding muscles in to build something (anything) that is both wizardly and useful.

This years edition of “Clash” starts at 6pm tonight, Wednesday March 30th. While people are encouraged to brainstorm ideas and form teams ahead of time, no code shall be written until the event starts.

During the event we are treated to full time catering, shoulder and neck massages as well as other free-form geek activities. (I hear Christian will have his new Oculus Rift around for testing.)

While remote nerds can choose to stay remote and participate, anyone who wants to come into the office can. Last year I was at home and didn’t really get into it. This year I’m working out of the office so I’m anxious to see how it all works out.

As for my project and team, I’m still working on it. I have an idea and if need be will work on it solo but am also hosting a meeting after lunch for ‘Clash Singles’ to see if we can form some last minute teams.

At the end of Clash (Saturday, 6pm) we have a nice BBQ dinner (spouses and kids welcome) and we run a science fair of sorts, where people demo their work and answer questions. People are judged on project complexity, presentation and other factors. Bonus points are awarded if your team was interdisciplinary (mixing people of different departments) and if you were able to integrate any of the emerging technologies on our watch list. Top prize allows you to choose from list of high end geeky toys (think drones and musical instruments) with second/third prizes getting some nice Amazon gift cards.

I’ll post more as Clash gets going. If you have any questions let me know.

Xcode Shortcut: Quick Open in Assistant

This answer / revelation caused a bit of a stir in the Philly CocoaHeads Slack so I figured I’d share it here as well.

Lots of people know and live by Xcode’s Quick Open Menu. You hit Command-Shift-O and start typing the name of a file, a class or a method and have some very good options made available to you. Make a selection, hit return and bam, the file is now live in your editor.

But what about the assistant editor? Historically some of the best uses for the assistance editor was to view a file’s counterpart file, the header for an implementation file and visa-versa. With Swift’s lack of a header files, some people have come to put use the assistance editor of test files.

Regardless as to what you want in the assistant editor it’s always been a little clunky to pick the file. Well now you can use the Quick Open menu for this too, and it’s oh so simple.

Hit Command-Shift-O and make your selection as normal. Instead of hitting Return, hit Option-Return — the file will now open in the assistant editor pane, opening it if need be.

Quick Open in Assistant in Action GIF

That’s all there is to it. It’s a small feature but very handy for those trying to stick to their keyboard and avoid the mouse while moving around in Xcode.

For a handy Xcode 7 Shortcut Reference Card check out the Big Nerd Ranch iOS Course Resource repo for a PDF download. You can also get the card in print by ordering our latest edition of iOS Programming, 5th Edition — updated for Xcode 7 and Swift 2.

PS: Props to @lyricsboy for catching my typos!

Video: Consuming JSON in Swift

I gave a talk at Philly CocoaHeads last week reviewing various ways to consume JSON using Swift, including a preview a new open source project we have coming out soon™ from Big Nerd Ranch called Freddy.

Consuming JSON in Swift, Mike Zornek from Philly CocoaHeads on Vimeo.

JSON is a fundamental internet format and if you are building iOS apps the chance you need to download and consume JSON files is extremely high. Additionally, with the introduction of the statically typed Swift language it’s been a little more difficult to work with JSON properly. This talk will cover what JSON is, how one can work with it naturally in Swift, the limitations of doing so, a review of a few popular third party solutions and the introduction of a new JSON tool about to be open sourced by Big Nerd Ranch.

Slides: https://speakerdeck.com/zorn/consuming-json-in-swift

How To Play WWDC Sessions at 2x Speed

Now that all the new bits of iOS 9 and OS X 10.11 are in the wild you might find yourself wanting to get up to speed on some of the changes. One great resource to help you get started is Apple’s WWDC videos.

The WWDC video library has a lot going for it: HD and SD video sizes, slide downloads and now even full text search! The only real negative thing is the sheer amount of content out there. It can get overwhelming and time consuming to watch all the stuff you are interested in. Here’s the hint. Like podcasts, WWDC videos are mostly single voices speaking one at a time and if you have the tools to double the playback speed you’ll find them still very comprehensible.

Now for the tools. For downloading you can of course use the Apple website. I like this WWDC Mac app as well. Once you have the video file on your hard drive you’ll unfortunately need to look for something beside the built-in QuickTime player to help. Even with all its enhancements it sadly doesn’t have this tool of QuickTime’s past. The good news is you can still download QuickTime 7 and it works great!

After you open your movie in QuickTime 7 (you’ll find it installed in the Utilities folder), use the Window menu and choose Show A/V Controls. In this panel you’ll see a slider that let’s you adjust the playback speed.

QuickTime 7

Now you can watch your chosen WWDC videos in half of the time! Enjoy!

UPDATE: My thanks to Paul Brown who let me know that the native QuickTime player can playback faster, even if it is a little hidden. To increase playback speed, bring up the controls with your mouse, then option-click on the fast-forward control. This will increment playback speed by 10% each time you click. You can keep clicking this up to 2.0x playback speed but sadly the audio does not work at 2.0x, you’ll have to limit yourself to 1.9x to retain the faster audio. Thanks again for the help Paul!

Code Patterns Talk, Video Now Available

We’ve been trying to a better job of capturing our main talks at Philly CocoaHeads. You can find and subscribe to our small but growing collection of videos on Vimeo: https://vimeo.com/phillycocoa.

I did a talk last month reviewing a some iOS code patterns. The runtime is about 27 minutes. Feedback very welcome.

Some Code Patterns, Mike Zornek from Philly CocoaHeads on Vimeo.

This talk covers a handful of code patterns that were successful on my recent projects. Some of these patterns include Block Safety, "Tell, Don't Ask", Using DataSources for your network-based *Service objects.

Apologies the audience participation isn't well captured.

Girl Develop It: Introduction to iOS Development

The Introduction to iOS Development class I’m teaching for Girl Develop It is open and tickets are for sale.

This class will provide attendees an introduction into iOS development through a mix of lecture-style presentations and lots of hands on coding exercises that in total will demonstrate what it is like to be an iOS developer.

The 2-day class costs $100 and will be held on Saturday Feb 7th and Sunday Feb 8th.

If you know of a woman in the Philadelphia area who is interested in iOS please let them know. Thanks.