Brian M. Coyner

Excellence in Software Development

West St. Louis CocoaHeads, May 24, 2012

UIStoryboards Are Awesome!

By Brian Coyner

iOS 5 introduced Storyboards. This talk shows how to effectively utilize storyboards to create and visualize your app’s workflows. We will focus on using Storyboards for both iPhone and iPad.

  • Introduction
  • Building Static and Dynamic UITableViews and UITableViewCells
  • Responding to Segue Transitions (including popovers)
  • Programmatically Invoking a Segue
  • Composing custom iPad scenes with multiple view controllers (includes UIViewController containment)
  • 6:00pm - Meet/Greet
  • 6:15pm - UIStoryboards Are Awesome! by Brian Coyner
  • 7:30pm - Next Meeting Details, Questions / Discussions

St. Louis County Library Headquarters (East Room); (314) 994-3300; (40 & Lindbergh).


View Larger Map

OCUnit Tip: You Only Need a .m File

If you are writing OCUnit tests, then you should only have a source (.m) file. There is no need for a header (.h).

Why no header (.h)?

  • test cases are, by nature, private implementation details
  • no need for a public interface (test cases are never imported by other test cases)
  • it is completely legal Objective-C to have the @interface and @implementation in the same file
//
// BTSPreferredTransferTest.m
//

#import <SenTestingKit/SenTestingKit.h>

@interface BTSPreferredTransferTest : SenTestCase
@end

@implementation BTSPreferredTransferTest

- (void)testSomethingUseful
{
    // Test implementation
}

@end

West St. Louis CocoaHeads, April 26, 2012

Introduction to Cocos2D

By Brian Paulsmeyer

This session covers the following Cocos2D topics

  • menus, touch input, timers,
  • sprites (with actions and animations)
  • layers, tiled maps (with scrolling)
  • joysticks/button pads,
  • particle emitters, projectiles
  • 6:00pm - Meet/Greet
  • 6:15pm - Cocos2D by Brian Paulsmeyer
  • 7:30pm - Next Meeting Details, Questions / Discussions

St. Louis County Library Headquarters (East Room); (314) 994-3300; (40 & Lindbergh).


View Larger Map

West St. Louis CocoaHeads, March 22, 2012

Getting Started with Core Data in iOS 5.

By Byron Bennett

This session digs into the following Core Data topics:

  • Using the new UIManagedDocument
  • using Xcode to build an entity model
  • executing “fetch requests”
  • using NSFetchedResultsController to sync data with a UITableView
  • 6:00pm - Meet/Greet
  • 6:15pm - Getting Started with Core Data in iOS 5 by Byron Bennett
  • 7:30pm - Next Meeting Details, Questions / Discussions

St. Louis County Library Headquarters (East Room); (314) 994-3300; (40 & Lindbergh).


View Larger Map

We Made an App for That

The West St. Louis CocoaHeads is providing St. Louis iOS developers a chance to showcase his or her app(s) at the February West St. Louis CocoaHeads group. The idea is taken from the CocoaConf session with the same name. The session provides developers ~10 minutes to demo each app and discuss the effort, challenges, successes, etc. he or she experienced during development. Each participant is encouraged to give away app promo codes. I am really excited to hear all of the great stories behind the apps.

Please let me know if you are interested in participating in this event.

This session will take place on March 1, 2012 (the February meeting) after the main presentation.

West St. Louis CocoaHeads, March 1, 2012

What Your Mom Never Told You About Notifications

By Mark Schisler

The iOS Notification Center is a great way for app developers to notify users of matters which require their urgent attention. However, it can become one of the quickest ways to annoy users via what may be the most obnoxious personal communication medium ever devised by man, prompting users to uninstall your app, or worse write a bad review. This presentation will consider the best practices for implementing notifications as devised by the Apple Guidelines and other notable app experts. From there we will take a look under the hood at the technical details of implementing local and push notifications, including some PaaS options that might help (most notably: Urban Airship and Heroku via the APN on Rails framework.)

NOTE: The February meeting is Thursday, March 1.

  • 6:00pm - Meet/Greet
  • 6:15pm - What Your Mom Never Told You About Notifications by Mark Schisler
  • 7:30pm - Next Meeting Details, Questions / Discussions

St. Louis County Library Headquarters (East Room); (314) 994-3300; (40 & Lindbergh).


View Larger Map

My Notes on CocoaConf

I recently attended CocoaConf in Raleigh, North Carolina. CocoaConf is a new conference devoted to iOS and OS X programming. Dave Klein and his family put on a great conference.

I would like to share some of my thoughts about the conference. My goal is to provide some highlights - based on the notes I took - of each session. Every speaker did a fantastic job. My comments and opinions are based solely on the notes I took during the session. Please let me know if I misunderstood or misquoted you.

Day One

UI Automation by Jonathan Penn

I have been very interested in the UI Automation tool. I just have not had a lot of time to dig in. Jonathan’s talk definitely revitalized my interest. The only major downside, in my opinion, is that the tool requires writing all test scripts in Javascript. I have been avoiding Javascript for over a decade. I guess I have to finally accept that Javascript is here to stay and “learn to love it”. Or use KIF.

The funniest part of the session is when Jonathan showed how to record a script through Instruments. Simply launch the UI Automation tool in Instruments, start the app, and click away. The tool automatically inserts lines of JavaScript. The audience ooh’d and ah’d. Jonathan quickly jumped in front of the screen and shouted, “No! Don’t do this. I was not expecting that reaction”. Jonathan went on to explain how to break up test scripts into manageable chunks. He also recommended a JavaScript library called Tuneup to help make it easier to write test scripts.

Be sure to check out Jonathan’s UI Automation articles at http://cocoamanifest.net.

Core Data, The Real World by Saul Mora

The majority of Saul’s talk was showing large or “complicated” blocks of Core Data code and then showing how his Magical Record framework reduces the code to “one line”. I guess this is helpful, though I am not quite sure yet.

My unwavering advice is to learn as much about Core Data (or any framework) first. Once you master the “core framework”, then wrap it with whatever makes your programming life easier.

Master the Address Book by Collin Donnell

I attended this session to see if my own experiences with the Address Book framework are similar to Collin’s. Indeed, my experiences are similar. The Address Book framework is a C-based API. I thought Collin did a great job showing how to use the Address Book framework. He had plenty of code samples showing how to manipulate groups and contacts.

Core Graphics by Bill Dudney

I have watched Bill’s WWDC 2011 Core Graphics talk at least five times (maybe more). Though his talk was the same as the WWDC talk, I still got plenty out of the session. Bill is a fantastic presenter. You should definitely grab Bill’s WWDC “Practical Drawing for iOS Developers” video (session 129) and sample code. You will learn a ton.

Quote of the session: “Never ship programmer art!”

I believe Bill recommended picking up a copy of Programming with Quartz, which is the same book I recommended a few months ago.

Git by Collin Donnell

Collin did a great job converting at least one team to Git. At the end of the session, I heard that team saying, “we have got to move to Git”.

I learn something new every time I read or hear something about Git. I use Git for my private projects and my public GitHub projects, including this site.

Credit Card Software Development by Jared Richardson

Jared led the audience through some of his thoughts on “technical debt”. I had two big takeaways:

  • technical debt should not be normal (just like personal debt should not be normal)
  • Starbucks coffee generates expensive pee

Here is a question I now have: “Do programmers that generate a lot personal debt also generate a lot technical debt?” Something to ponder.

Overall, the session was fairly interactive and entertaining.

Day Two

iOS Gestures and Event Handling by Nathan Eror

Nathan presented a basic overview of gesture recognizers. Nathan did a good job describing how to create and configure the built in gestures, as well as how to handle gesture events.

Nathan also showed an example mimicking the iPad Photos pinch animation to navigate between two view controllers. He said don’t use the code in a production app… it’s not the right way to do it. I asked myself, “then why show it?” I guess the general technique is what he was aiming to explain (viz. the transform property is your buddy). I am now kicking myself for not asking him the “right way” to do it.

Overall, I thought Nathan did a good job leading the session.

Storyboard Development by Daniel Steinberg

Daniel completely validated what I already knew about storyboards - storyboards are awesome! The CocoaConf attendees agreed, too, because this session was voted the best. I also voted for this session.

During the session, Daniel walked through building a small app using storyboards. There were numerous oohs and aahs throughout the presentation. Most people agree that storyboards are awesome. Hopefully we will see storyboard improve in future releases.

If you are targeting iOS 5, then you should be using storyboards (or least investigating them).

Unit Testing that Doesn’t Suck by Daniel Steinberg

In this session, Daniel walked through using Kiwi, which is an Objective-C unit testing framework based on RSpec and built on top of OCUnit. My initial reaction to Kiwi was “really? ugh!”. I just don’t see how Kiwi makes writing tests “not suck” (at least any less than OCUnit). I am not a stranger to writing tests. I am an advocate of uniting test and even co-authored a book on JUnit years ago. I plan to stick with OCUnit until there is something so dramatically different as to change my entire unit testing philosophy (or Apple ditches OCUnit for something else).

On another note, I started writing OS X/ Objective-C unit tests using a library called UnitKit by James Duncan Davidson. This was back around 2006. UnitKit died when Apple embraced OCUnit. Oh how I wish Apple would have embraced UnitKit instead.

Instruments by Saul Mora

This session was pretty interesting. Saul did a nice job walking through some of the basics of Instruments. The highlight of this session was when he walked through a real-life NSZombie hunt. The issue turned out to be this block of code (hope I regurgitated the code correctly).

// category on UIView
- (void)dealloc { 
    [super dealloc]; 
}

Think about it for a bit.

Wrap Up

The CocoaConf conference is currently small (less than 100) and very inviting. By inviting, I simply mean every one I met was very friendly and engaging. There were people attending who were new to the platform, and others who had been programming on the platform for years.

The conference also included keynotes by Andy Hunt and Daniel Steinberg, as well as a fun session called “We made an app for that”.

Many thanks to Dave Klein and his family for organizing this great conference. I hope to be back again soon.

One More Thing (a little name dropping)

One of the many highlights of my weekend was at the airport on the way home. I got to sit down and talk with Bill Dudney and Collin Donnell in the Southwest Airlines terminal. Both Bill and Collin are both very nice and great to talk to. It was awesome to get a chance to talk with them in person. Thanks!

West St. Louis CocoaHeads, December 22, 2011

Embracing OCUnit

I have been practicing writing unit tests for over 12 years. In 2002, I co-authored an O’Reilly book on JUnit called Java Extreme Programming Cookbook. Over the years I have written thousands upon thousands of tests. I have developed creative techniques for testing seemingly untestable code. My goal is to help those new to testing get started with OCUnit, as well as help veterans of unit testing make the most of OCUnit.

OCUnit is a standard xUnit framework integrated into Apple’s Xcode environment. OCUnit, like all testing frameworks, has its pros and cons.

General Details

  • Set up an Xcode environment (logic and application tests)
  • General guidelines for test organization
  • Writing tests and using assertions (similar to other xUnit libraries)
  • Discuss what I believe are the pros and cons of OCUnit
  • How to overcome the cons (or at least get by)
  • Look at various testing techniques (including creating a “parameterized” OCUnit test harness that uses Blocks as tests)
  • Discuss why I choose to keep using OCUnit over other tools like GHUnit and Kiwi.

By the end of this talk you will have a good foundation to start writing effective OCUnit tests. I promise to design my talk to be about an hour or so.

Schedule

  • 6:00pm - Meet/Greet
  • 6:15pm - Embracing OCUnit by Brian Coyner
  • 7:30pm - Next Meeting Details, Questions / Discussions

St. Louis County Library Headquarters (East Room); (314) 994-3300; (40 & Lindbergh).


View Larger Map