CocoaConf Boston 2014

I attended the Boston stop of the CocoaConf tour this year. As always, it was a quality experience. I learned a ton, and I’m still processing all the valuable information that was crammed into my brain. The Klein family puts together a great mix of technical content, community interaction, and fun events.

The speakers were top notch. I got to meet Ben Scheirman of NSScreenCast fame, who I’ve admired for a long time. Both of his talks were packed full of useful information. Laura Savinola had my favorite session, which was basically 45 straight minutes of Xcode tips, tricks, and hacks. (Lots of note-taking and audience participations in that one!)

The event is paced so that the technical content is buffered with 15 minute breaks, some less technical talks, and meals in-between. In my opinion, this prevents your brain from being completely overwhelmed with technical content. It also gives the attendees a chance to mingle and have some good side conversations.

As always, if you get a chance to attend an CocoaConf, grab the opportunity. I’ve been 3 times, and had great experiences at every one.

Formatting Phone Numbers With TextExpander and Ruby

I’ve been doing a lot of contact management and formatting of phone numbers into notes lately. I had a lot of frustration around formatting phone numbers copied and pasted from different sources.

Unit Testing Patterns for Asynchronous Networking Communications

A common issue I always run into is how to test asynchronous methods, especially networking calls. I used test the result of the calls, such as the parsing of return data, because testing the entire method proved impossible. I recently read an article from the excellent objc.io publication on asynchornous testing. By combining the patterns used in this article with some refactoring, I finally have my networking code under unit tests. Here’s what I did.

A Change in Direction

In hitting brick walls, taking road trips for work, and feeling guilty about about posting in weeks, I have reconsidered the return on investment when fully implementing logic tests. I have dealt with compiler flag issues, missing imports, manually adding .m files for compilation, and a host of other issues. After having my own doubts, and reading this post (the entire thing had me nodding my head), I’ve decided to reconsider my take on application vs unit tests. Going forward, I’m going to rework this series from the start using application tests.

They seem to be much quicker to run now. They are definitely a win in the setup/configuration department. Logic tests are much more difficult to implement.

Stay tuned for more.

Setting Up iOS Logic Tests [Part 4]

This is part 4 in a multi-part series on iOS unit testing and integration testing. In the last post, we discussed setting up Core Data and the Magical Record library. This week, we’re going to set up our logic testing bundle. Let’s get started.

Orientation Changes in iOS 6

In a current project, I had the need to have one specific view controller present its view in landscape orientation only. Pre-iOS 6, I would have overridden the shouldAutoRotateToInterfaceOrientation method and returned UIInterfaceOrientationLandscape. In iOS 6, this method is deprecated. I began researching how orientation issues should be handled going forward, and here is the way I made my specific scenario work.

Quick Tip: TextExpander/Octopress New Code Block

Just a quick tip. This blog is built using Octopress. Octopress uses Jekkyl to create a static HTML site using markdown files for the content. I’ve been slowly building up some markdown specific TextExpander snippets and Keyboard Maestro macros to make things easier.

Setting Up iOS Logic Tests [Part 3]

This is part 3 in a multi-part series on iOS unit testing and integration testing. In the last post, we discussed setting up SVProgressHUD.

Magical Record

Magical Record is an excellent library that compliments the Core Data framework. I’m going to assume some knowledge of Core Data here. If you need a reference, the Core Data book by Marcus Zarra is excellent, and just hit its 2nd edition. We are going to build out a very simple data model, with just one entity. This will allow us to set up the core data stack and verify that Magical Record is working.

Setting Up iOS Logic Tests [Part 2]

This is part 2 in a multi-part series on iOS unit testing and integration testing. In the last post, we discussed setting up the project and adding some dependencies with CocoaPods.

Today, I’m going to go through setting up some initial code to use the 3rd party libraries to make sure that the libraries are working. Then we’ll set up logic tests and see what breaks with CocoaPods (spoiler: compiler errors ahead!).

Setting Up iOS Logic Tests [Part 1]

I’m continuing on my task to get a full project using iOS unit tests and integration tests. My first step is to set up logic tests in Xcode. I recently watched an excellent unit testing course on Lynda. In that course, Ron Lisle goes over the advantages of using logic tests. The most compelling factor in using logic tests over application tests is speed.