Our DNA is written in Swift

Hacking UIScrollView Gesture Recognizers

As of SDK 3.2 most of the touch handling code in stock controls has been taken out and replaced with this amazing new technology called Gesture Recognizers. This means besides of using them yourself and creating your own you can also fiddle with behaviors of standard controls if they interfere with your own gestures.

I’m currently working quite a bit on something based on UIScrollView and there I found several things that I needed to tweak.

Disabling Pinch

The first modification I did was to get around a bug in UIScrollView.  I did not actually want user zooming in my scroll view, but just use the setting of the zoomLevel to scale images without having to redraw them. And you can only set the zoomLevel to values between min and max.

So, during autorotation, I reduced the min zoom scale, set the new zoom level and then set min and max both to the new zoom. But the problem with this, as of SDK 3.2., is that if you change the min or max zoomLevel property the scroll silently adds a UIPinchGestureRecognizer to itself via the addGestureRecognizer method that now all views have.
Read more

Service Announcement: Upgrading iOS 4 GM

A not-to-be-named friend asked me:

I would like your opinion the GM build. Should I (not sure how) remove it and then load the new iOS 4.0? I know it wouldn’t have the game center, but I don’t use that anyway. I am afraid if I don’t remove, the software will expire (happened on beta 4 and then I couldn’t use the phone (or back up first) until I could load the latest.

If you’re one of those developers that managed to install the iOS 4.0 Gold Master right after Uncle Steve announced it, then you might wonder if you should update to the really final release that came out just now.

Wait! That’s a trick question…!

Read more

BOOK: The Business of iPhone App Development

A long time ago, in a galaxy far far away … I think around the beginning of the year actually, Michael Schneider asked me to read this book that he collaborated on with Dave Wooldrige.

At this time and until this date this book remains the biggest and most comprehensive guide on what traps there are in the iPhone app business. It took me some time to read the book from cover to cover and then I also was simply to busy and lazy to do this review. And actually there was another reason, that I din’t want to admit to.

I’m by nature an iPhone app creator, not a business person. I had my first app in the store about 2 months after downloading the SDK back in 2008. Making apps is what I love, but marketing them… yuck! Now if this book really was as good as the table of contents looks then this would mean that I had found – rather by accident on twitter – the ultimate guide to everything that I needed to know about transforming my app workshop into a viable business.

Read more

Rendering PDF is easier than you thought

We all know by now that Adobe is almost as evil as …, well let’s say they pioneered a couple of functionalities that where great for the longest time. One being the PDF format which is actually totally built into OSX everywhere. On OSX you’re able to print into a PDF without having to install extra software. Also iOS comes with PDF support and today we’ll look at how we can draw a PDF in a view.

Note: This article examines the native PDF rendering capabilities of iOS, which are very basic to say the least. For a commercial solution to support high-performance PDF viewing, editing, and annotations in your app, we recommend PSPDFKit.

Read more

Xcode 4

In Austria we have a saying “Big things throw their shadows way ahead of them”. While the rest of home-staying iPhone … pardon iOS developers has only seen the Stevenote, a couple of lucky attendees where able to get their hands on a pre-BETA version of Xcode. They are still under NDA when it comes to discussing it, but you know how it is with Twitter, it’s not really possible to keep those things under wraps if people are excited and connected.

And also, since these details are now on the internet and thus public domain, wannabe journalists can scrape the few available details together and summarize them for you, my dear reader.

Generally developers love that Xcode 4 appears to be a total refresh, lots of thought is apparently being put in, all the more reason to look forward to it. Attendees of the WWDC got a download link on the Apple Developer Forums, but us regular folk only gets an error message. Some People think it was changed too much (T, T) for comfort, but a revolution is never easy.

But for the most part you find only happy tweets (T) and comments.  Here’s my rundown on the features we have heard about:

  • Interface Builder becoming part of Xcode for a combined IDE. T T
  • There is a new Counterparts View that is really convenient. T
  • There is a Code Snippet feature, possibly similar to Dashcode. T T
  • LLDB will replace the current GDB debugger. T
  • New LLVM compiler. (2x compile speed improvement. up to 25% runtime speed improvement. On iphone up to 60% faster apps!) T
  • There will be Tabs. T
  • MDI (Multi Document Interface) where you see multiple source files within the same Xcode window. T
  • Great GIT Support. Improved Subversion Support, too. T T
  • You will be able to choose different skins for the IDE. T
  • Revamped project and target settings for choosing build configurations, localizations, deployment target,etc.

Installation will takes about one hour (T). Because of the amount of things you can have on screen at the same time, you might want to get a monitor of at least 27″ in size (T).

Several people (T T) mentioned June 21st as possible avilability date of Xcode 4 as preview version. But I’m sure your buddies who made it to WWDC will let you take their Xcode 4 for a spin. 😉

How to make your Hybrid-App crash for sure

I was quite happy finally getting the new polished 1.1 version of SpeakerClock approved. But there was one problem: people who tried to run it on iPhones with iOS 3.1.3 started tweeting me that it crashes. I was astonished, I was not aware of using anything from 4.0, I just had to set the base SDK to 3.2 to support hybrid mode.

Then I tried out the update on my wife’s iPhone which I kept at the latest released iOS version, 3.1.3. And it crashed. So I hooked it up and had a look at the crash report. There’s something about “doesNotRecognizeSelector”. This means I am calling a method that the receiving object does not recognize. Uh Oh.

Read more

Dr. Touch #17 – “This Changes Everything, Again”

What the Stevenote means for us developers.


The Show Notes aka Script after the break

Read more

SteveNote (Quasi) Live

Like every good follower I shall be glued to my big iMac to listen read the latest news from Steve Jobs when he takes the stage at the WWDC 2010 keynote. Somebody called my a “FanBoi”. But I’d rather be a FanBoy than a Fan of a Boygroup. 😉

Apple is always extremely protective of their resources. So they just won’t exert any efforts in streaming the event but rather post a stream a couple of hours later on apple.com and add it to the Apple Keynotes Podcast even a few hours after that. But that does not mean that you have to wait for the info. The web is your friend.

UPDATE: Send me your Skype name. We’ve established a skype chat channel and there’s already a lively conversation in progress.

Here are some sites that have a proven track record (for me) of relaying what’s going on. I will plaster my 27″ iMac and my 15″ MacBook Pro with these.

  • Engadget live – Great Live Blog with Photos
  • Gizmodo Live – Usually head to head with Engadget on the frequency of updates and photos
  • TWIT Live – Leo Laporte is broadcasting live and if there’s any live video or audio then he’ll get it
  • MacRumors.com Live – they formatted their live bloggingsite ideally for iPhone/iPad

Other Liveblogs (as recommended by Gizmodo) to take your pick from: gdgtArs TechnicaWiredTechnologizer,NYTMac Life, and Apple Insider.

I won’t be making an effort to relay the info, because so many other people are doing that. But I’ll be making notes as to which things are of especial interest and importance to us iPhone developers.

Newly published: iOdometer

Previously I explained how I am approaching iPhone development in a broad spectrum. The vehicle for my business is a company called Drobnik KG, or as I refer to it in IT context: drobnik.com.

We have a publishing contract with young Laurens whose apps are already making up a major portion of our daily sales. The agreement works like this: I’m taking care of the stresses with dealing with Apple, submitting the app and maintaining the SVN-server where the apps are being developed. For this convenience Laurens is sharing part of the profits with us.

And profits they are! Over the last half year this arrangement netted Laurens sufficient funds to buy a Mac. Thus invigorated he sat down and developed a distance measuring app: iOdometer. This, too, is selling far better than I might have guessed. So I refrain from making any future predictions concerning Laurens’ success. For some strange reason he seems to exactly hit the nerve of what people are willing to pay for.

Maybe that’s because of the high quality components from Dr. Touch’s Parts Store he implemented: DTLEDNumberView and DTMenuController. Being able to rely on their sturdiness and ease of implementation he was able to focus on the app’s main feature set and bring it to market in record time.

iOdometer is available on the app store. Version 1.1 has been submitted to Apple, it features better accuracy and a new icon. Other successful apps by Laurens are Frequency Annoyer and Full Screen Browser.

SpeakerClock 1.1

My previous article covering an iPhone-to-Universal migration inspired me so much that I spent two days on getting the HD-upgrade for SpeakerClock ready to ship.


  • Universal app, runs on iPhone and on iPad in native resolution
  • Portrait Mode, now all orientations are supported
  • Now screen flashes in the appropriate color when threshold to yellow or red is passed
  • In-App Purchase for 5 presets instead of one
  • Lot’s of minor usability improvements

I didn’t know if Apple would approve an iPad-ready app if it did not support all orientations. So I implemented a mode for portrait orientations for iPad and retrofitted it for iPhone as well.

A big thank you goes to Erica Sadun who inspired me to take on these changes. When I met her on the Voices That Matter Conference in Seattle she played around with SpeakerClock as if it where the coolest of all toys, making me really proud of it. But I cringed seeing the iPhone-app on her iPad so I definitely had to make a HD-version. I dedicate this one to Erica.

I also added the information on how to start and stop the timer to the instructions. Some people did not understand that you can do so by simply tapping the screen.

Also this version marks the end of the “free trial” for SpeakerClock 1.0. As soon as it goes live I will raise the price. So if you want to get it for free, then better get it now. If you liked 1.0 then the new + button is your chance to show your appreciation, it will give you 5 instead of 1 preset. A preset saves the timer starting value, the yellow and the red threshold values.

Personally I use SpeakerClock whenever I’m recording YouTube videos. A couple of times I went over the maximum of 10 minutes and my handy timer prevents this for good. Here’s a demo of the old and new features.

SpeakerClock 1.1. has been submitted to Apple for approval.

UPDATE: … has been approved.

UPDATE 2: … has a nasty bug where it would crash on all iPhones with an OS Version less than 4.0. So I already submitted an 1.1.1 update.

UPDATE 3: The 1.1.1 hotfix is now available on the app store.