BuySellAds.com

My book Barcodes with iOS 7 is nearing completion. Buy it now to get early access!
Our DNA is written in Objective-C
Jump

Cocoapedia

Do you know any facts? Like what you did before getting into iOS development? Or are you possibly looking for facts? Those facts that make blog articles much more interesting?

In this case, let me introduce you to the Cocoapedia. The name should right away invoke two associations: Cocoa, as in Apple’s API we use for developing for Mac and iOS devices. -pedia as in Encyclopedia or Wikipedia. As it should be with any self-respecting Wiki I have written up the history of Cocoapedia on its article on itself.

It’s actually the second time already that we’re launching this, the first time was a complete and utter failure. I had thought that it would smart to make it invitation-only to be able to regulate quality. But this actually prevented any kind of spontaneous growth that makes sites like Wikipedia great. So I’ve abolished these restrictions, everybody can now edit Cocoapedia and they should!

Now, don’t get me wrong, Cocoapedia is not supposed to replace any blog, forum or Q&A site like StackOverflow. Also it should not become a dumb link collection.

Have you ever wondered why some topics are on Wikipedia and why some are not? In May 2008 I wanted to know and added an entry for myself, which promptly got removed again stating that it would not be relevant for addition. From which I learned that relevance is something quite subjective and not even Wikipedia’s set of rules can objectify this dilemma.

We Cocoa developers live in our own universe which has different kinds of rules than mighty Wikipedia. To give a prominent example: Aaron Hillegass is on Wikipedia, while Erica Sadun is not, even though the latter was written dozens of books. Now, unless you are a big fan of Aarons, you probably would agree that this omission is odd. Erica has done much more for us developers but apparently has not hired an experienced Wiki-Writer to add an article for her that would pass under the stern eye of the Wikipedian.

Cocoapedia offers a remedy.

Here the idea is that all facts, events, conferences, apps, components and people connected in the least with Cocoa development have a place to go down in history. Though bear in mind that it is facts that makes a Wiki great. I don’t want to read self-glorfying hymns. I DO want to read a bit of biography and – if any – factual accomplishments, preferably with a footnote that proves them.

Over time Cocoapedia has the chance to grow into a compendium that bloggers would consult to fact-check articles on specific people. There are often disparate bits of “About” spread over developers online sites, blogs, twitter streams and Facebook pages. If you want people to know who YOU are, then you need to provide them with a concise entry.

Making an entry is very easy, I made a tutorial video showing how you can quickly start a new article which you would then fill with some facts about the topic of the article. I randomly chose Gleb Dolgich from my twitter followers who did not mind me creating an entry for him.

Don’t forget that everybody is an editor, so you never truly “own” a page on Cocoapedia. We’ve already had a bit of vandalism, but that’s easy to remove by the undo function. For extreme cases it’s possible to lock pages for a while but experience on Wikipedia has shown that in digital media, where Vandalism can be easily removed, it is generally very short lived. It’s simply less work to revert an article to a good state than it is to vandalize it.

You can look at any page’s source by going to the Edit mode. You most quickly learn Wiki-Editing by copying pieces of such code to your own articles. Consider the article about yourself your first exercise. Then once you have mastered that create references and articles for items related to you. For example if you have a partner for some of your apps, then just enclose his name with double square brackets. This will make it an intra-Wiki link which allows to create a new article if you follow it.

Finally, I request of you that you pass on this information of what need Cocoapedia is trying to fill with the help of an army of contributors. See you inside!

iCatalog.framework brings Digital Catalogs to Life on iPad

Somehow I was restless this night. When I checked my e-mail I see the reason why. My fine tuned app store antenna has been tingling as it usually does before something great happens on the app store.

There was a joyous e-mail by my US partner on the biggest project I had done in my iOS carreer so far:

All four RedCats iCatalog Apps have been approved by Apple and are now live on App Store.
Thanks for all the effort you’ve put, and continue to put, toward making this the best possible product.

The whole thing started when I got contacted on May 30th by Octavio Cifuentes at International Color Services asking for an “App Development Quote Request”. ICS specializes in digital pre-press services for top-brand retailers and cataloguers. They where looking for a contractor to do an app for them. To put it in layman’s terms, ICS is getting PDFs from catalog companies and they make sure that the colors match the clothes that are being sold. So they wanted to have a product to offer to their customers to take this PDF and make it into a digital edition for an extra free.

The Start of a Beautiful Partnership

At that time I was thinking about doing a magazine/catalog framework loosely based on the Wired-App. If you remember I reported on how Wired is saving all pages as PNG files and using an XML file to create the structure for the magazine. They where shooting over the target with that because they used full size PNGs for both orientations making one edition around 500 MB including videos. But the general way of doing it intrigued me.

When I responded to ICS’s request (after having done the usual NDA dance) I gave them three options:

  • you can become a software company and hire somebody to work on this (not me)
  • or you can outsource it to some eastern Europe or Asian country. But then you’ll need an experienced project manager to keep taps on your cheap labor. (not me)
  • or you can partner with me. I retain full ownership of what I create, but you have the exclusive rights to sell apps based on the framework I’ll be creating

At first they where hesitant, but the more they thought about it, the more they realized that only the third option would give them what they wanted. I argued that if you let your partner retain a stake in the project the outcome will be dramatically different than if it’s just a job where you bill your hours. And naturally ICS did not want to turn themselves into a software developer.

I met with ICS’s CEO James Kearns in Milano, Italy, and there we shook hands on the deal. He’s an amazing person to deal with, a gentleman as he is a scholar. What I liked especially was that he offered to pay for my development expenses because I needed something to live off from while developing the framework.

R&D

A lot of experimentation was necessary initially, especially on how to render PDFs. The challenge there was twofold: 1) you could not render the PDFs directly because of the bad drawing performance that the iPad has and 2) because there where thin lines all around those PDFs due to some print-specific features that are being used. These lines are hairlines and disappear in printing, but they show up as 1 pixel lines in the PDFs. So we chose to pre-render the PDFs at a multiple of the resolution which makes the pages super-crisp and the hairlines disappear.

Much work also went into working around performance limitations of the iPad. In my tests the decompressing and drawing of a full screen image would take up to 300 ms which would cause enormous jerkiness. Only 3 frames per second is much less than the ideal 60 frames. I solved this dilemma by moving the page drawing onto a background thread with the help of CATiledLayer. But not without opening a bug report at Apple to complain about the bad image performance. Now scrolling on the iCatalog apps is smooth as button, only if you scroll very quickly you see pages pop up after a brief delay. But this is the best you can get without resorting to OpenGL.

Octavio was my counterpart at ICS and he did all the designing and stuff while I was able to concentrate on the programming of all the features. It’s not immediately obvious at first glance but there is a great deal of small things that we had to polish, polish and polish. I could not have done without a person at the creative helm. I don’t do design. I had some ideas about usability and experience in what would work in an app.  But I don’t like to push pixels around in Photoshop. So OC and me where the perfect team for this task.

Catalog vendors are particular when it comes to so called “Spreads”. If you open the catalog you have two pages next to each other and you might have something that is continued over both pages. So I had to create a way to animated smoothly between the portrait and landscape mode retaining info on which page you where. Say you start in portrait mode and rotate the page you where at was a right page. If you then rotate back you end up on the same page. This is one of the many details that make or break a digital catalog experience. And one kind of thing that you as a developer don’t think about, but need an experienced guy like OC to tell you.

Another thing that I am particularly proud of is the scripting engine that is the heart of all catalogs. Up until the minute that the apps got approved I was worrying a bit that Apple might see this as a rejection reason and I formulated in my head a response. All the interactions in the catalog are written as Objective-C statements that at runtime are converted to NSInvocations with the appropriate parameters filled in. So it’s not a real interpreted language or scripting engine per se, but more like a single statement parser. But it works great. Because of this I’m able to quickly add any new feature. All I need to do is to write the method to execute and then this becomes immediately available for use in all iCatalogs.

It’s only natural that iCatalog also supports video and audio playback but those you best see for yourself in the Jessica London iCatalog app.

Online Integration

All iCatalogs work great if you are not connected to the Internet. There are however two things that you might want to get connected for:

  1. Sharing individual products or your entire Wish List on social networks
  2. Purchasing

I knew from my experience that Apple would reject all apps that don’t work well if you are in airplane mode. That’s why I took extra care to fail gracefully if the internet connection drops out. Reachability 2.0 to the rescue!

Online Purchase integration is different for each catalog client. For the initial batch we chose to just integrate it with the existing online shopping bag. All your wish list and shopping bag items are kept on your iPad until you tap the checkout button. When you do – and if you have Internet – your choices are transferred to the online site and there you fill in your address and credit card info to complete the purchase. Down the road we want to get a proper XML API to transfer the shopping bag, but for now this method works great.

I saved much time when implementing the social sharing functions by not coding them myself but instead using ShareKit. This enables us to share items through a multitude of social media sites right out of the box. Fortunately the most pressing bugs had been fixed just in time for this release.

Edit This

The interactive areas where the second source of pride. I called them “Hot Zones” and they are basically rectangles you draw on the catalog page with the editor. Then you specify different actions for single tap, double tap or automatic execution on page showing. You can assign an icon, a sound and many other options to fully customize what such a hot zone would do. For example the feature “Swatch Match” is constructed such that you have multiple variants of a catalog page with different colors of a product which you can flip through by tapping the button.

Speaking of the Editor. Initially we considered doing an app to do the editing of catalogs. But since I never did a Mac app before I incorporated all the editing functions into the iCatalog project itself. This way OC can immediately check that what he sees is what he gets when putting together a new catalog. By running the editor version in iPad Simulator he gets the best of both worlds: the look and feel of the catalog on the iPad as well as all the benefits of the desktop like access to the files and multi-core rendering performance.

I might still do an editor down the road if the framework has stayed stable for some time, but until this occurs having an in-app editor is the best solution. This edit mode is easily disabled when building an app for a client by means of making a simple change in the PCH file.

How To Get Your Own iCatalog

I know that some people out there might be tempted to trying to do something similar. Maybe you have been contacted by somebody with a catalog or their agency and asked for a quote. While it has been an extremely rewarding experience for myself I would not recommend for anybody to undertake it unless the company looking for a digital catalog is prepared to pay at least 3 months worth of development for it. Not to speak of the ongoing work that is necessary to polish it and add new features as they become necessary.

The alternative to spending thousands of dollars is to license the iCatalog.framework. As I mentioned previously ICS is my international commercial partner for it. You can contact Octavio Cifuentes to schedule a demo and explore how ICS can help convert your catalogs into a compelling iPad experience. At any case I recomend to you check out any or all of the free iCatalog apps that are already in the store.

Update: Here’s a demonstration of the iCatalog framework and a peak behind the scenes on how such a digital catalog is made.

DTBannerManager 1.3

After having worked on the official MobFox Framework it was only logical that I would add support for this new ad network to DTBannerManager as well. Well honestly, I actually developed the framework inside of DTBannerManager and when it was done, I made it a static universal framework.

And then there was the goal of having a method to allow customers to purchase “Ad-Freeness” via an InAppPurchase. As with all IAP stuff you have to create your own UI for it, so I had a friend and designer create dual-resolution artwork for an X-button that you can link with your own IAP code or use DTShop.

Have a look at a video demo of these new features that I put on YouTube:

If you have purchased DTBannerManager source code access before then you find these updates in your repository if you refresh it.

Custom-Colored Disclosure Indicators

Sometimes you may want to have a different background color on your table views than Apple White. One problem you will most likely be facing is that this makes it impossible to use the regular table view cell accessories. Black arrows on black background are kinda hard to see.

You will have to draw your own. And in this post I’m going to show you how I did it.

Just today I discovered a mechanism that makes it even easier to roll your own custom-colored accessory view. The property name containing the word “view” is somewhat misleading in this case. You might be tempted to create your own UIView subclass and override the drawRect to draw there. This has one disadvantage though, you cannot switch colors when the cell gets highlighted.

Update Feb 1, 2013: DTCustomColoredAccessory presented in this article is now part of our Open Source DTFoundation and covered under a 2-clause BSD license. You can either uses it with attribution for free or you can purchase a non-attribution license in our parts store.

Read more

Embedding Binary Resources

When creating a static universal framework we’re facing one quite annoying problem. How do we get our pretty images added to the app bundle that our code will be used in?

Contrary to what you might be used to on the Windows platform there is no built-in method of embedding graphics files into an app binary. Because of this you see famous SDKs like FBConnect provide a bundle together with their libraries. To add these you have to add both the library/framework and the graphics bundle to your project.

Bundles are basically just folders that have been named with the .bundle extension. This hides their content from lazy clicking, but you can still look inside in terminal or by right click and “Show Package Contents”. This opens the bundle like a folder and you can edit its contents.

Now for the longest time I had a longing to package library and SDK code in neat frameworks that you would simply drag&drop into a target project. I managed to build two libraries and glue them together so that the same library can be used for building for simulator and device. Then guest author Netytan demonstrated how you can hack a bundle project to create a framework instead. The graphics problem was literally the only open loop to close.

Until today …

Read more

MobFox

You might remember that I created DTBannerManager to maximize ad revenue by getting ads from iAd where available (US, UK) and everywhere else from AdMob. Using these two networks left me wishing for a network that could also provide good results in Europe which is the third largest market for iPhone apps.

The European market is only large when viewed as a union, but due to a multitude of different languages it is unlikely that you’ll see iAd coming there next. Apple will probably continue rolling out their network but focus on English-language markets first: Canada, Australia, New Zealand etc. Lately I’ve been getting around $0.18 per click on iAds.

Click-through payments from AdMob are way lower compared to that, about $0.0225 per click. The reason being that AdMob typically serves small-budget developers, guys just like us, who just don’t have the kind of budgets that Apple managed to acquire for their current two markets.

BUT, a solution to this dilemma literally found me. Newly founded MobFox, their home in the Austrian capital Vienna, aims to fill what the other big networks leave to be desired. MobFox concentrates on the D, A, CH markets which share German as their common language. Their idea is similar to iAd, namely to acquire mid-size to large advertisers via agencies. Currently they have several advertising campaigns that pay around 12 Euro-Cents per click, which is in the same league as iAds.

When the MobFox CEO approached me to win me over to try their network I met him at their headquarters, a small office near the bustling Mariahilfer Street, Vienna’s most visited shopping street. I explained to him what we European developers really need and told him about DTBannerManager and how I could add it there as a third network. Then we parted ways.

A few days later I set up my first mobile app to be able to download the SDK. But I was shocked! The documentation was incomplete and partially altogether incorrect, mentioning class names that didn’t exist and telling me to set my publisher id via a #define which does not have any effect because this only works at compile time. In short, this SDK was utter crap.

So I offered to rewrite it to make it usable and less confusing which was gladly accepted. About 14 coding hours later I had created a universal MobFox.framework. I modeled it after the iAd.framework, except for a delegate method to get the publisher ID, which I implemented similar to what AdMob did. Amongst all the improvements were:

  • Hiding superflous and unusable methods from the developer to avoid confusion.
  • Make all web requests carry the appropriate user-agent string: “MobFox/3.0 (iPhone)”
  • Add capability to refresh Ads after time set on server
  • Allow for tel, sms, iTunes and other internally supported URLs as ad click-through URLs
  • Allow the developer to steer via online dashboard if he wants to show ads in an in-app ad browser or in Safari.
  • Embed graphics into the binary so that you don’t risk forgetting to copy these into your project as well
  • Ability to probe the click-through URL to see if it redirects to an external app. This way tap throughs are tracked but the user does not get an additional white safari page pop up but is immediately forwarded to the external app, like app store.
  • Proper error handling and communicating of resolution steps to developer

We documented two methods on how to add the framework to your app, either via Interface Builder or in code. In the least you have to implement the delegate method to provide your publisher id, which is unique per mobile app that you set up on the MobFox dashboard. The “advanced” demo shows how you can easily slide in an ad if you receive one or hide it if you don’t.

I’m really proud of what I created. The new MobFox SDK framework is clean, efficient and easy to implement in your own apps. I would like to encourage you to try it out. I’ll add it to several apps of mine over the coming weeks and I’ll report back once I have facts about all 3 networks to compare.

I have also included MobFox as an additional option in DTBannerManager; all you have to do there is to fill in your publisher ID in the config file. I believe the optimal strategy to be: try iAD first, then try MobFox, else go with AdMob. This gets you the highest paying ads for US/UK, D/A/CH and everywhere else we fall back to AdMob.

For a limited time only I am also able to get the threshold adjusted what an ad must pay for it to be served to you. This way you can pick out the cherries while still receiving ads from other networks. Send me an e-mail if you add MobFox to any app and I’ll get this set up for you.

Cocoanetics

When I announced my intended name change some days ago and invited suggestions my brand “Dr. Touch” had served me well as a placeholder since end of January 2009. With some drawbacks. First it is hard to get people to associate iOS development with it, secondly it sounds to some as the job title of a registered sex offender.

Starting out it made sense to make this a personality-based blog. I wanted to be your friend in development, somebody you would come to in times of need, somebody you would trust to share your story and business with. Undeniably this got a bit of recognition with the heterogeneous community, as my excursion to a conference in Seattle was able to prove. This landed me several great projects, the biggest of which you’ll see unveiled in the next few months.

BUT, I never got the kind of recognition I was really lusting for. While I’ve been busting my iMac, all the other iOS Developer Stars where writing books, being invited to speak on conferences and had their apps featured up the app store and down the iPhone blogs. Time to re-evaluate what I really want to achieve.

What is it that YOU want?

If fame is out of the question because the air up there is too thin, then what is it that I should set my sights on at this stage? What am I doing well? What do I like? What content of mine is appreciated the most?

1000 unique visitors per day tell me that at least some of my blog posts continue to attract a steady interest. The 10 hottest landing pages currently are:

And this order does not change very much. It’s only when an article, like the one on backgrounding, received a treatment by TUAW it gets catapulted into this list. What does this list tell you about my interests or rather the interests of my readers?

I see: understanding difficult concepts, fixing problems resulting from unnecessary complexity on behalf of Apple, and 30% my source code products. That almost sounds like a plan to me. So let’s pretend that I planned it like that all along. :-)

The Genesis of Cocoanetics

A new name changes everything, it’s like a new uniform that you don the first day as member of a Starfleet crew. The funny thing is that I had it slumbering in me already without being aware of that. It burst out of me like the proverbial chest cracker when I called for suggestions: “… studying to become a Doctor of Cocoanetics …”

Right then and there I had coined a new word. A while after I had published the article I reread it (like most narcissist bloggers would do) and then Cocoanetics moved into my conscious consciousness. I immediately googled for it and was astonished to find that there where exactly zero entries. I registered the domain and re-checked after a few days and then the only entries where my original article plus some sites that are mentioning my domain registration.

I received about a dozen or so suggestions for domain names, but most of them where variations of “Dr. Touch”, some ok and some really fruity. But honestly I had fallen in love with the new word. The best ideas are the once that you think you had yourself.

So, announcing the winner of the new name competition: me. ME ME ME. Sorry, but thanks for playing.

I like about the name that it still has a bit of a scientific touch. I consider learning iPhone development a science. Also I think it’s fun to play mentally with the collision of Cocoa (like the development framework we use) and Genetics (pieces of code that are the program for something larger). To mind comes a picture where you see a DNA strand that upon closer inspection turns out to consist of Objective-C code.

So: out with the arrogant Doctor who thinks he’s something better. In with the Cult of Cocoa. And no, that’s not meant serious, I’m not going to found a religion. Unless … would you be willing to join? :-D

We need a new Design

I asked the twitterverse for some recommendations for good designers because obviously a good name also needs a good site design. This is the first time that I’m actually hiring a professional to design something for myself. One of the first recommendations was Clockpunk Studios and they responded swiftly, professionally and courteously. UNLIKE two other designers (who shall remain unnamed) whom I had to beg for an answer, only to get a snarly response from one and a rejection from the other. So that made the decision rather easy.

Jeremiah Tolbert from Clockpunk Studios sent me a questionaire to fill in some sites from within the same area of business and so I compiled a list of other blogging developers, again with the help of some crowd sourcing. So I went through the list and noted what I like and what I don’t like in terms of design choices: colors, typography, layout, flow etc.

Here’s the list in case you want to spice up your daily dose of Cocoa:

  1. http://cocoawithlove.com/ – Matt Gallagher
  2. http://www.red-sweater.com/blog/ – Daniel Jalkut
  3. http://jomnius.blogspot.com/ – Jouni Miettunen
  4. http://www.cimgf.com/ – Marcus Zara
  5. http://mattgemmell.com/ – Matt Legend Gemmell
  6. http://iphonedevelopment.blogspot.com/ – Jeff LaMarche
  7. http://furbo.org/ - Craig Hockenberry
  8. http://iPhoneIncubator.com/blog/ - Nick Dalton
  9. http://www.buildingiphoneapps.com/ - Jean-Francois Martin
  10. blog.jitsik.com – Unknown Author

If you know any more then let me know in the comments. I also invite comments about the name. What associations does it provoke in your mind?

What's In a Name?

When I started this blog I was already drawing on multiple years of blogging experience. But this second blog of mine was supposed to be highly focussed on iOS development. More out of a gut feeling than anything else I chose Dr. Touch as a monicker and sort of a brand name. I figured that this would contain some geeky references:

  • “Dr” like “Drobnik”,
  • but also like “Doctor”. For  two reasons: 1) I am both studying to become a Doctor of Cocoanetics and 2) I am also learning a lot by fixing up other people’s code, like a Medicus.
  • Touch derives from Cocoa Touch, which you know is the set of frameworks that we use to program iOS

Now it just so happens that I am moving servers. From a virtual Windows box to a real Linux server. I’ve already transferred all my domain names to network solutions because NS got recommended to my by a friend whom I fully trust. Having the names on a different service than who’s hosting your domain gives you a great deal of flexibility.

But carrying out this move actually got me thinking: Currently all my iOS stuff is in a subdirectory of drobnik.com. That might be great for me ego to have my name as domain. But at the same time it dilutes my “brand” because “Drobnik” means so many other things on Google. I might hold the first few places there, BUT to convince people that “Drobnik” and “iOS development” are synonymous is an uphill battle.

So it’s clear for me at this stage that I have to find a new domain name. A name that’s independent from my personal name, but something catchy, something that will get people to know instantly what this site is about.

The usual combinations of Doctor and Touch are taken, and I don’t want to resort to DoctoreTouch.com, even though this has a bit of italian flair. And this name also carries the fatal flaw that it takes a bit of brain acrobatics to get from Dr. Touch to iOS Dev.

This I’m announcing the quest for my next name. Mail me your suggestion (or DM me on Twitter) and if it wins over all the other ones that are being sent in, then I will reward you handsomely with your choice of cash or components from my shop or personal development help.

I will announce the winner as soon as we get to transfer the blog to the new server and establish the domain.

Microsoft Continues to Fish in Apple's Pond

I previously reported about having gotten e-mail from a Microsoft representative. It turns out, that was only the US activities.

Today I got a phone call from a lovely lady (obviously native German speaker) from CBS, you know, those TV guys. CBS apparently also does telemarketing and they got hired by Microsoft to call all European iOS developers to try to see whom they might get on board of Windows Phone 7. CBS has received a list of developers from Microsoft who seem to have gotten it by scraping the app store.

Microsoft is offering the following trinkets to make the switch a bit more interesting:

  • 75 Euros Sign-Up Fee waived if you have at least one WinPhone7 compatible app released by December.
  • free tech support
  • they’ll even reservere your app name for you on their store
  • a slew of workshops
  • a free copy of Windows 7 for your development PC
  • a free mobile device

I interrogated the caller a bit about how their activities are working out so far in other countries and especially in Austria. She said that it’s going really well in Great Britain and Italy, and so-so in France and Germany. I was the third Austrian iOS developer she had called, but she just began. Well, having a name beginning with D got me on the third place of an alphabetical list it seems.

Hey, and you don’t have to totally switch. Just “make one app compatible” until December to not have to pay the sign up fee…

Being the solo-developer that I am I certainly don’t want to spread myself too thin. Also I don’t think that it would be wise to branch out to other platforms while I still have so much more to learn about iOS development. Some time ago I formulated my own credo to be “focussed on iOS, but diversified widely on one platform.” That’s my plan.

But you’re free to do whatever you like, if a free Windows 7 mobile phone is all it takes for you to turn your back on iOS then please DO leave.

DTChartView 2.0

I had originally begun development on my chart class for BabyBubbles, which required customizable charts to display various statistics on whatever babies you might have. At that time all of the view building and logic was contained in a view controller, DTChartViewController. This app was the first to launch with the 1.0 version and I’ve never had any complaints.

When I continued work on iWoman 2.0 I realized that it would make more sense to make the box with the chart a view of its own. Especially because I wanted to have the ability to show a small chart which would zoom to use the full screen when rotating your device. So I got to work on 2.0. Amongst other polishing I wanted to clean up the delegate/datasource interface to use method names that inform the developer that they belong to DTChartView.

That’s how the datasource protocol turned out. You can see that very little is required to get a chart to show, but there is a boatload of options to customize the appearance of the columns and lines.

@protocol DTChartDataSource
 
@required
- (NSUInteger)numberOfPointsInChartView:(DTChartView *)chartView;
- (CGFloat)maximumValueInChartView:(DTChartView *)chartView;
- (CGFloat)chartView:(DTChartView *)chartView valueForPointAtPosition:(DTChartDataPointPosition)position;
 
@optional
- (NSInteger)numberOfLinesInChartView:(DTChartView *)chartView; /* default 1 */
- (CGSize)unitSizeInChartView:(DTChartView *)chartView;; // default: automatically calculated
- (CGFloat)minimumValueInChartView:(DTChartView *)chartView; // default: 0
- (NSArray *)chartView:(DTChartView *)chartView arrayOfValuesForBarsAtPosition:(DTChartDataPointPosition)position;
 
// column grouping
- (NSUInteger)chartView:(DTChartView *)chartView groupForColumn:(NSUInteger)column;   /* column grouping */
 
// customizing look
- (UIColor *)chartView:(DTChartView *)chartView backgroundColorBehindPointAtColumn:(NSUInteger)column; /* no fill if not implemented */
- (UIColor *)chartView:(DTChartView *)chartView colorForLineAtIndex:(NSUInteger)index;  /* default colors are provided */
- (BOOL)chartView:(DTChartView *)chartView drawCustomBarInRect:(CGRect)barRect onContext:(CGContextRef)context forLineIndex:(NSUInteger)lineIndex; // custom drawing of bars
- (BOOL)chartView:(DTChartView *)chartView drawCustomBackgroundInRect:(CGRect)barRect onContext:(CGContextRef)context backgroundType:(DTChartBackgroundType)backgroundType;
- (BOOL)chartView:(DTChartView *)chartView drawCustomDataPointAtPoint:(CGPoint)point onContext:(CGContextRef)context position:(DTChartDataPointPosition)position;
 
// horizontal axis customization
- (NSString *)chartView:(DTChartView *)chartView textForLabelInColumn:(NSUInteger)column;
- (BOOL)chartView:(DTChartView *)chartView customizeColumnLabel:(UILabel *)label;
 
// vertical axis label formatting
- (NSString *)chartView:(DTChartView *)chartView titleForLabelAtValue:(CGFloat)value; // custom formatting for y-axis labels
 
// legend
- (NSString *)chartView:(DTChartView *)chartView titleForLineAtIndex:(NSUInteger)index; // name for legend
 
// display of placeholder for empty chart
- (UIView *)viewForEmptyChartView:(DTChartView *)chartView;
- (NSString *)titleForEmptyChartView:(DTChartView *)chartView;
 
@end

In the meantime another customer found DTChartView and purchased it. Every time this happens, this invigorates me and prompts me to to polish just a bit more. Helmut Neumann took it upon himself to take the 2.0 BETA and add it to the latest version of his successful cellphone usage tracking app.

Without any fear or reservation he pointed out all the shortcomings and drove me to iron out all those kinks. So finally, when he got the update approved it was at the same time the seal of approval that I wanted to get to allow myself to release version 2.0.

I’m always happy to hear when customers of the Dr. Touch’s Parts Store report on how happy my work made them.

“Two months ago i wanted to add Charts to HandyEtat, my well settled cost control app for T-Mobile Germany. I was already using My App Sales and liked the integrated charts. So I was quite happy to find DTChartView in Olivers parts store, espacially when noticing the unbeatable price and license conditions. DTChartView is feature rich, highly customizable and rock solid in execution. Integrating it into my App was “a piece of cake”. Oliver showed a great performance on taking over and implementing enhancement requests. The new version of HandyEtat got an overwhelming response from my customers, so I am very pleased with my decision to use DTChartView.”

DTChartView 2.0 is available on my Dr. Touch’s Parts Store. I’ve priced it so high because of the enormous amount of work that went into it, knowing well that this would limit the number of apps using it. But on the other hand it makes it a charting solution that can make your app stand apart from the competition.