Ad

Our DNA is written in Swift
Jump

Author Archives rss

Bit Masks

Joseph Collins asks:

How do you decipher a bit mask from an argument which logically OR’d multiple values together? Enum uses bit shifting.

This question came to me while looking at UIView’s header file and wondering how Apple handles the animation options bitmask.

If you have several modes of something then usually you get by with an emum. But if you can combine several flags in s single value then you have to do this by means of bit masks. Let’s explore these today.

Read more

BinPress Contest Results

Today BinPress announced the winners of the component contest. I had the pleasure of being one of the judges.

BinPress had custom-built an internal microsite for us judges where we could download the source code and fill in a form with our judgements. That allowed me to go into the components I was assigned to and really dig into the implementation details. Sorry, but I need to be wagging my finger here, all of the ones I saw had terrible form, little to no code style, the project setup generally was a mess and documentation non-existent.

But nevertheless a ranking was possible – especially because there where other equally important judging factors besides code quality. And so the shining winners are …

Read more

Command Line Tools Tutorial (1)

Honestly I was very much excited when I found that I can use my current knowledge of Objective-C and Foundation classes like NSString to also build nifty little tools. Previously I had to resort to bash script to perform one-off operations on files that where too tedious to do manually. But knowing what I am going to show you in this article will enable you to also write these littler helpers.

I believe that beginners should rather start with writing a couple of command line tools before diving into building user interface driven apps. Commend line tools are linear and thus their function is easier to grasp. They are more akin to “functional programming” then “object oriented programming” if you will.

I am going to show you what goes into building a simple command line tool and you be the judge whether you agree with my assessment.

Read more

Linguan 1.0.2

The second hot fix pack for Linguan 1.0 fixes a couple more issues that some of our (mostly) happy customers reported.

Changes

  • Fixed: Translations will no longer get trimmed
  • Fixed: Problem opening projects with absolute file paths
  • Fixed: Table did not update on deletion of token
  • Changed: Extended duration of “no new tokens found” HUD
  • Changed: Enter key now opens selected recent project in welcome screen

If you haven’t done so please post your feedback on iTunes. To be able to add additional features to Linguan we need to have sufficient sales. And for that we need your positive reviews, high rating and that you tell other developers about Linguan.

Today is the best day for them to also get a copy because: As a Thank You for your interest in our app we reduced the sale price by 50% until the new version gets approval by Apple.

Coding Style

Dany asked:

I’m looking at your (nice) project NSAttributedString-Additions-for-HTML and I have some questions about your convention of writing code.
I really hope that you can reply to me, and maybe can be an idea for a future blog post (on naming conventions, and conventions in general for objective-c).

I adopted several styles I read about in the coding style guides by Google and Marcus Zarra, though I have to admit I only skimmed through these and picket a couple of things that made sense.

Though it is good practice to reflect on your style every once in a while to see if it still serves the purpose of making your code easier to maintain and read.

Read more

Sub-Projects in Xcode

A very interesting yet very undocumented functionality of Xcode is that you can have sub-projects in your project tree. You can add an xcodeproj to your project and link to this project’s output.

This is exceptionally useful if you are developing some functionality in a contained project and now want to access this polished functionality from another project. Like for example you want to add to your app the capability of accepting HTML code copied from Safari and use my DTWebArchive classes for that. You could either copy all classes to your project, build two libraries (one for Simulator and one for Device, or lipo these two together), or build a static universal framework.

Or there is an option number 4 which I want to tell you about in this post. This option does neither copy source code nor does it involve building something upfront.

Read more

Amazing Apple-like Documentation

I know I know, Documentation is a bad bad word, especially for us creative people. The true creativity is in writing code, not in writing comments, isn’t it?

Well, regardless, you might find yourself in the situation that you want other people to reuse your code. Or better yet, a different self of you in a year should be able to understand your line of reasoning of today. If you do programming for a longer time you will pass the phase of being shocked at how bad your code was and then get into the phase of having no idea what you where thinking. So a liberal sprinkling of comments can help you get up to speed on your old code.

I invented a technique of chewing on a portion of a programming puzzle where you comment almost every line of code as if you were to explain to somebody the steps in your ingenious approach. Maybe somebody else coined a term for this, for me it helps me sort my thoughts. And probably will do the same a year or ten from now. So commenting comes naturally to me, Documentation by Comment-ation is a logical extension to the concept.

Read more

“Steal Good Stuff” – iOS Design Pattern Collections

Rule Number 1 if you’re going to “borrow” from other great people is to only steal things that are worth stealing. You know, good artists borrow, great artists steal.

We are dealing more and more with people in large corporations suddenly finding themselves tasked like “hey you, design this iPad app!” The problem with that is that these people often don’t yet own an iPad that they use all the time. They are used to thinking in concepts that make sense on Windows machines or in web browsers, but not on a large multitouch panel.

Fortunately for us several people have started collecting examples of great UI designs for us to peruse. My Twitter followers came up with quite a selection.

Read more

Linguan 1.0.1 – Ginormous Hotfix Pack

My partners at BytePoets have been causing their keyboards to emit steam from walking through 26 issues that we identified on the 1.0 release just 9 days ago. Almost all had been identified as typical “oh shoot” elements, mostly items that you only find when people begin to actually use your software. Also I was able to smuggle in one or the other new feature since I consider “user confusion” also as a form of bug that you should hot fix if you can.

Read more

We’re Hiring

Our business has outgrown our capacity. Cocoanetics has 2 large clients with long-term projects plus is successfully selling components that need to be polished and maintained. Add to that our visibility and you can imagine that we get frequently approached with interesting projects that we have to often turn away. “We” refers to myself, Oliver Drobnik and my partner Rene Pirringer. We love to develop and polish apps and are having a blast.

As it currently looks the momentum of the markets we are in is speeding up, not slowing down.

So we are looking to hire …

Read more