Author Archive

Philly Beer Week iPhone App

Friday, June 11th, 2010
icon-app-store

I’m a little late in mentioning this, but I had the pleasure of creating an awesome iPhone app with an even more awesome group of peeps.

Last week we pushed out the Philly Beer Week 2010 iPhone app.

We have had an awesome response and, more importantly, it was fun working with the crew we assembled from Philly Cocoa and Indy Hall.

If you happen to be around Philly this weekend to sample some of the fine brews, try the app out and let us know what you think. Also feel free to by us a beer!

The Philly Beer Week iPhone App crew:

Johnny Bilotta (@johnnynines)

Kevin Lee (@stubborndreams)

Michael James (@mj1531)

Andy Mroczkowski (@amrox)

Jake O’Brien (@flailmonger)

Corey Floyd – Me! (@fjalapeno)

FTUtils Fork

Friday, April 9th, 2010

I recently forked FTUtils to provide some functionality I needed for FJSTransitionController.

These changes may be of use to others as well.

1. Diagonal direction control.
For when you want to slide a view in from the corner of the screen.

2. Enclosing View support.
This is a bit convoluted, but: All animations in FTUtils are assumed to move in and out of the full screen.
When would this be an issue?
If you perform 2 animations at the same time that are enclosed in a view that is less than full screen. Basically, this boils down to the animation curves will be “out of sync”.

I have been absent, but I come bearing gifts…

Tuesday, March 16th, 2010

I haven’t been a very good steward as of late (I have excuses I swear!)

On a good note, I have finally uploaded a few snippets for the world to use.

First up is: iPhone Context Views (Codaset) (Github)

This is a very simple view class that will pop up context views/menus for users to interact with. This probably flies in the face of the HIG, but oh well. I must also admit this was heavily inspired by TaskPaper for the iPhone, which is an awesome app for notes/tasks/outlining.

The views use a simple delegate pattern which most Cocoa Devs should find familiar.

For my next trick, I present FJSTransitionController (Codaset) (Github).

“What is this TransitionThingAmaBob,” you ask? Well, FJSTC is a custom “top level view controller” to be used as a replacement for UINavigationControllers and UITabBarControllers. It handles transitions between view controllers, but with more flexibility.

Instead of managing a stack or an array of view controllers, FJSTC manages a Dictionary. You can associate VCs with keys and load them arbitrarily.

“But I want more!” you say. Well instead of giving FJSTC a fully instantiated VC, you can simply provide a class and it will instantiate it on demand. you can provide a nib as well.

Another requirement was the proper calling of viewDidAppear: and friends. This was done using the nice SDNextRunloopProxy class by Steve Degutis.

Just like UITBC and UINC, you can access the transitionController through an instance variable on all UIViewController instances (made possible by a UIViewController category):

[self.transitionController loadViewController:vc forKey:myKey];

And lastly, transition animations. You can set a transition animation type, duration, and direction (if required). The animations were enabled using FTUtils, a fantastic core animation wrapper with several stock animations (you really should check it out, as I said before).

So now you can load arbitrary view controllers with arbitrary animations in just a few lines of code.

These are both relatively new and assuredly have some bugs, BUT I am using them both in applications I am building right now. So, I will find those bugs, yes I will.

If you have a minute, check them out, and break as many rules in the HIG as you can!

iPhone OS 4 and Backgound Tasks or “Why We Don’t Have a Calendar API”

Wednesday, January 20th, 2010

This has been on the burner for a while. With all of the iPhone OS 4 / iPad / iSlate hoopla, I figured I better get it out the door before it all becomes a moot point.

One of the most perplexing omissions in the current SDK has been the CalendarStore API. It seemingly goes hand-in-hand with the AddressBook APIs and is every bit as important for contact management on a mobile device.

But alas, here we are on OS 3.1.X without any support for accessing a user’s calendar. Not even the “second-class citizen” readonly kind.

Although I’m sure the iPhone team at Apple has a pretty big todo list, I can’t help but think there is something more to this mystery…

I submit to you, the reader, that the forthcoming Calendar API is intimately linked to a background processes API. Huh?

I know, but let me explain.

When iPhone OS 3 appeared on the scene, Apple bestowed upon us a gift known as Push Notifications. But lets face it, they suck. For one, they only serve a few specific types of applications. And, perhaps even more detrimental, Push Notifications are hard. Hard to implement. Hard to host. Hard to scale.

Now some will disagree regarding degree of difficulty in setting up a Push Notification server, but none can argue that requiring developers to deploy a server just to fake background tasks is ludicrous.

But to my point: If only we had something like Push Notifications, but more flexible with no server requirement. Also, why not let us execute arbitrary snippets of code when our app isn’t running.

Now were getting somewhere. So, lets put it all together.

I have an app, say an alarm clock app (I know easy example). I want to schedule an alarm, so I call the calendar API and schedule an event.

CalAppEvent *newEvent = [CalAppEvent event];
[newEvent setStartDate:someDate];
[newEvent setRecurranceRule:hourly];
CalCalendar* appCalendar = [[CalCalendarStore defaultCalendarStore] sharedAppCalendar];
[newEvent setCalendar:appCalendar];
[[CalCalendarStore defaultCalendarStore] saveEvent:newEvent span:CalSpanFuture error:nil];

But wait, instead of a simple alarm, maybe I want to play a sound file from my app bundle and deliver a context specific message to the user. Maybe I even want to open a network connection.

If only we had an easy way to capture lexical scope and pass off some code to be executed by another process. How about:

[newEvent setAlarmBlock:myBlock];

Now when my event fires, I can run any arbitrary piece of code!

Now you see the possibilities. Is this true background process support? Not quite. But it is close, very close.

It provides nearly all the flexibility we need, while preserving battery life. Not to mention it avoids deploying and maintaining a server. We’ve effectively leveraged existing technologies (albeit 10.6) and since the calendar process is always running, why not exploit it for all of our multitasking needs?

Additionally, this implementation provides users with a familiar, easy to understand UI for managing background apps: the Calendar app. Simply open the special “Background Tasks” calendar to view all upcoming events scheduled tasks all of your apps.

Of course this is all speculation as I can assure you I have no inside information. I am sure that Apple has a much more elegant solution, but I can’t help but think I am on to something…

Thank you for indulging me in my little though experiment.

Development Links: Redux

Monday, December 28th, 2009

This is an update to my previous post

Below is a list of my subscribed developer feeds along with a link to each home page.

At the end of the post you will also find an OPML file if you are so inclined

Enjoy!

First are the Aggregators:

All development feeds:

And if you would like to add these straight to your favorite feed reader, here is the OPML file:

google-reader-subscriptions.xml.zip

Lastly, I used this little web app to parse my opml file.

Open Source iPhone: FTUtils or “Super Awesome Canned Animations for the iPhone”

Thursday, December 17th, 2009

Are you using this?

You should be.

FTUtils contains several classes that allow you to easily add semi-complex animations to your app, for “free”.

It’s a nice abstraction of Core Animation (which is a great abstraction of OpenGL + Quartz in it’s own right)

Check out the demo app to see what you can do.

Open Source iPhone: Resources 2

Tuesday, December 1st, 2009

Another list of open source libraries:

http://boredzo.org/opensourcelinks/byauthor.html

Open Source iPhone: Resources

Wednesday, November 18th, 2009

Great Resource, tagged and organized:

http://cocoaheads.byu.edu/resources/open-source

Originally suggested in this Stackoverflow question.

Obscure iPhone: viewDidLoad and loadNibNamed

Tuesday, November 17th, 2009

Quick tip.

Sometimes, instead of traditional nib loading, you may want to use the following method:

[[NSBundle mainBundle] loadNibNamed:@"MyViewController" owner:self options:options];

For instance, if you want to provide a runtime replacement for proxy object in your nib (see UINibExternalObjects).

If you do this and you also need to perform setup after the nib loads, you’ll come across an unexpected behavior.

viewDidLoad will not be called (Nor does awakeFromNib).

I wouldn’t classify it as a “bug”, I can see the rationale, but it is dubious and I have (so far) been unable to find any documentation on this behavior.

So if you do need to do some setup, place it in viewWillAppear (You are using a UINavigationController or UITabBarController, aren’t you?).

We Finally Got It! (In App Purchases)

Thursday, October 15th, 2009

We now have in app purchases for free apps (read: trial ware).

It’s not quite perfect, as I am sure most developers would like to allow full functionality to users for a timed duration. (Maybe this will be allowed?)

From a consumer side, I hope this isn’t abused to much.

I have a strong feeling that we will see much more of a lash back if users of free apps are constantly bombarded to make in-app purchases.