Using iAds and Storyboards

7.2.2013

Recently, I incorporated iAds into one of my apps and found it puzzling that there were no quick 5 minute guides on how to do this with storyboards. Apple provides some great example code for XIBs, but it won't work out of the box with storyboards. Apple suggests using a single iAd instance throughout the app. If you have multiple instances, it may harm your iAd revenue and end user performance. Secondly, you want to hide the iAd view when there's no ad to display.

This short tutorial will get you going with iAd storyboard integration in 5 minutes flat. We'll use the code from one of Apple's examples, tweak it a little to properly load from a storyboard, and subclass our storyboard views. This tutorial assumes you're using a tabbed app (UITabBar). Easy stuff. Let's begin.

  1. Link the iAd.framework to your target. iAd.framework
  2. Grab the the modified BannerViewController class (.h|.m) from the demo project and import it into your own project. initWithCoder and making it work with auto layout were the core changes. Import BannverViewController
  3. Subclass your UIViewControllers to be BannerViewControllers. Subclass UIViewControllers
  4. You're all done. Launch the app in the simulator or on your phone and wait a few seconds for the ad view to appear. Simulator

If you're having any trouble, take a look at the demo project I pieced together.

The World's Knowledge is Free

6.6.2013

Ben Milne, a fellow midwesterner and the founder of Dwolla, dropped some profound yet obvious statements during this year's Big Omaha conference. He proclaimed "the world's knowledge is free". He's absolutely right.

Five years ago, I didn't know Obj-C, Node.js, or how to smoke a brisket. Ten years ago, I didn't know anything about PHP, MySQL, or how to properly crimp RG6 coax.

I learned all of these skills not by going to class or reading a book but by using the power of the free information on the web.

A proper education is important and Ben acknowledges that during his talk but all tactical skills I use daily didn't come directly from my formal education. However, outside of trade schools, perhaps education isn't trying to arm us with knowledge but the ability to find the knowledge we need (right now) on our own.

The Old is New Again

5.2.2013

I'm a little slow on the uptake when it comes to new languages, frameworks, stacks, etc. My goto for anything web backend has always been PHP, either in the form of CodeIgniter, ExpressionEngine, or the one off WordPress install. With my place on the web, I wanted to do something different, fun, but also a usable platform for me to sputter my ideas and useless knowledge onto you.

So here's the low down. This site is using Poet, a Node.js blog engine built on top of Express. I'm using Jade templates with JSON/markdown content stores. Poet can evaluate any type of post format from Jade to markdown to your own custom format. It had me thinking. Using JavaScript and plain text files to serve up content in the 21st century. What's old is new again.

In terms of hosting, I'm hosting this site on Red Hat's OpenShift PaaS. It's simple (deployment via git) and for the purpose of this blog, free. The site is also being buffered by CloudFlare (another first). So far, I'm relatively impressed with the benefits.

As you have probably figured out, I'm using Twitter CSS bootstrap. It's easy. There's not much to say about Twitter bootstrap that hasn't already been said, so I'll leave it at that. Bye for now.