Ad

Our DNA is written in Swift
Jump

Author Archives rss

… and Bonjour to you, too!

In the blog post before this one I began my investigation into TCP connectivity and Bonjour. I set out to create DTBonjour as part of my DTFoundation set of tools to make communicating between Macs and iOS devices extremely easy.

Then I spent a couple of hours on putting together a proof-of-concept app that would show me what’s still missing on the API. Having some classes disconnected from real life use is quite a different ballgame than actually showing it in action.

I asked on Twitter for some suggestions what app to make to show this off, but all where way more involved than the example that I finally decided on: a simple Chat app.

Read more

Bonjour!

For my Mac-based iCatalog Editor app I am developing a preview mode that allows for on-device previewing of iCatalogs. This is modeled after the Preview mode in iBooks Author with the tiny difference that there Apple restricts the preview feature to iPads connected via USB, which we will be using the full power of Bonjour to use any app that is running our specialized iCatalog Viewer app on the local WiFi network.

Apple has done a great job making service publishing and discovery a breeze. However they are severely lacking in the object-oriented Sockets department. in this blog post I’ll be developing an Objective-C library that will greatly simplify the process of finding, connecting and communicating with other devices.

And since we are developing for iOS and OS X in parallel the resulting code will work on Mac and iOS devices just the same.

Read more

Q&A: Licensing my Stuff

Luis asks:

“I’m a lawyer who represents a variety of software companies, and a former developer. One of my clients would like to use your nsnotifications/background thread code in their product. Can they use it under the terms of an open source license, such as the MIT license? If not, is it available as part of the Cocoanetics parts store, or some other license?”

Thanks for asking, Luis! I’m happy to answer this as I am considering your diligent asking as a compliment.

Read more

NSToolbarItem with Drop-Down Menu

For the toolbar in my iCatalog Editor Mac app I wanted to have have a toolbar button that would show a drop down menu for selecting what kind of hot zone the user wants to insert. iBook Author has a button like this and I was searching for way to get a similar look.

AppKit does not have this as a standard component, but I found two approaches that would yield a similar looking result.

Read more

NSScrollView contained in NSScrollView

For an inspector panel I wanted to have a horizontal collection view contained inside a vertical inspector scroll view. The vertical scroll view would only scroll if the window was too small to show all sections in the inspector.

The problem there is a NSScrollView gobbles up all scroll wheel events if the mouse pointer is on top of it. Here’s a solution how to have it selectively forward the scroll events up the responder chain.

Read more

Assorted Observations

While I am developing my first own Mac app I’ve been adding to this blog post whenever something was weird to me. Or simply different.

You can definitely see in many instances how some modus operandi on iOS has its roots on Mac, but Apple had to change things a bit around to accomodate the different UI paradigms on the mobile platform.

Read more

Linguan 1.1.2

This maintenance release for Linguan fixes a number of issues which where mostly reported by our users.

Changes

  • FIXED: blank path to ibtool considered valid
  • FIXED: broken display of relative paths
  • FIXED: weird handling of tab and return while editing
  • FIXED: Endless Loop with File Change Notifications
  • FiXED: Scan Sources did not add a token that was just removed
  • FIXED: Superfluous file modification message on saving
  • FIXED: Ordering by key should ignore case

Also we had to add a beautiful Retina icon for Retina MacBook Pro to be able to submit the update. It’s in Apple’s hands now and we will update this post as soon as it is through review.

We have to keep our fingers crossed because due to the way Linguan uses the xcodeproj it cannot be (easily) sandboxed. Though Apple had stated that they will accept minor fixes (like the ones mentioned above) for updates. We sincerely hope that they will honor this.

Update Oct 6th: Apple approved the update after 24 days. You can get it on the app store.

Once Upon a Contract

Notice: The following text is a rant and entirely my own opinion, not being a lawyer by profession, but a developer at heart.

Over the past month or so I was negotiating with a US-based company who wanted to retain my services as an expert on Rich Text and HTML parsing. Let me share a problem I had with a certain section in the contract that I was asked to sign, a problem that related to my previously created code and for-pay components.

Even experienced developers might be overly anxious to sign their next big contract to put food on the table without knowing what rights in their works they are signing over by this. This should serve as a gentle reminder: Better to read through the contract, all 19 pages of it, than having to be afraid that you inadvertently giving away your crown jewels.

If I learned one thing from Steve Jobs then it is to not trust contracts that are longer than a single page …

Read more

iPhone 5 Image Decompression Benchmarked

One of the first lucky owners of the iPhone 5, David Smith, kindly ran my Image Decompression Benchmark on the latest 3 generations of iPhone. These benchmarks measure the time it takes for an image to get from disk to screen and encompass 5 resolutions, PNG crushed and uncrushed, as well as 10 compression levels of JPEG. Christian Pfandler prepared the charts for us.

We like to repeat the same benchmarks on every new CPU that Apple likes to solder into their devices, you can read past analyses iPhone 3G through iPad 2,  iPad 3. One note of caution if you want to compare these to the results in this article, we changed the methodology of logging the times from NSLog to CFAbsoluteTime. NSLog itself takes up to 50 ms per logged statement. The new method is more exact and does not have this drawback of including the logging time in the measurements.

Executive Summary: the iPhone 5 can indeed be claimed to be twice as the predecessor.

Read more

Radar: First Responder defunct when used in Storyboard

Hot on the heels of my research into the responder chain comes this bug report. Nikita Korchagin deserves the main credit for mentioning this first to me.

Turns out that Apple broke the responder chain as it used to work on Mac and non-storyboard apps. I’m filing this as a bug report to find out if this indeed a bug or an “undocumented feature”. rdar://12402078

Update Oct 5th: Apple closed this as suplicate of rdar://12395544

Read more