Sam Soffes

Clean Up Your Project

Posted on

Many of the apps I work on are usually 100% custom. There is rarely any system UI components visible to the user. Styling the crap out of apps like this makes for tons of images in my iOS projects to get everything the way the designer wants. I'm starting to drawRect: stuff more these days because it makes it easier to reuse, but anyway.

There are literally hundreds of images in the Scribd app I've been working on. Designers changing their mind plus everything custom leaves a lot of images behind that are no longer used. Our application was starting to be several megs and a lot of it was unused images. So... being the programmer I am, I wrote a script.

It basically searches all of your source files for references for [UIImage imageWithName:@"image_name_here"]. Then it looks at all of the images on disk and removes any you didn't reference. I setup a whitelist for icons and other images I don't reference directly. You might need to tweak the paths a bit to work for your setup.

Continue reading →

Typical Sam

Posted on

National Geographic released a video about the typical human. It's really interesting. You should watch it.

I was curious how typical I am. Here's the typical traits and how I line up:

  • Right handed: Yep
  • Makes less than $12,000 a year: Nope
  • Owns a cell phone: Yep
  • Doesn't have a bank account: Nope
  • Male: Yep
  • 28 years old: Nope
  • Chinese: Nope

Continue reading →

How to Drastically Improve Your App with an Afternoon and Instruments

Posted on

I was bragging on Twitter about how I just made my application way better with some simple tweaks. I wanted to write a quick post about what I did that really helped that will probably help most people. This stuff is a bit application specific, but I think you'll see parallels to your application.

My application pulls a ton of data from the network and puts it in Core Data when you login for the first time. From using the application, I noticed that performance totally sucks at first and then goes back to normal. (My table views all scroll at 60fps, but I'll save that for another post. Sorry. Had to throw that in there. I'm way proud.) This was troubling since it usually works really great, (okay, now I'm done bragging about my cells) so I investigated.

Just so you know, I am doing all of my networking, data parsing, and insertion into Core Data on background threads via NSOperationQueue.

Continue reading →

Some SSToolkit Additions

Posted on

Over the weekend, I messed around and added some stuff to SSToolkit. The most useable thing I added was a simple badge view and cell that wraps it for shows simple badges like Mail.app in iOS. Here's a screenshot:

SSToolkit

Hopefully someone will find that useful. I also switched to LLVM 1.6 and increased the warning level to be more strict. Lately I've been a big fan of stricter warnings. I feel like I'm writing better code when it makes me check types, etc.

Continue reading →