Bitching and Stiching iPhone Apps (almost) since 1974
RSS icon Email icon Home icon
  • DTBannerManager

    Posted on August 6th, 2010 drops No comments

    You have AdMob ads in your apps? Wondering if you could make a bit more money if you also had iAds were available?

    DTBannerManager solves this problem for you. It allows for easily adding both networks to your code. Under iOS 4 it will first try to get an iAd because those also pay for just being displayed. If none is available then it automatically switches to AdMob, so your banner space is never wasted. It also features elegant sliding in and out of the banners and is able to display ad banners even over a tab bar controller, so they are always visible for maximum effect.

    You might argue that there are free ad networks out there who promise to do exactly this for free. So why would you want to get this component from me. Well, from you you get full source code and you see exactly what is happening. Also there is no server-side ad mediation happening that might get you in trouble with Apple. I believe that as developer you don’t want to involve too many additional parties and introduce too many external dependencies. With DTBannerManager you continue own all parts of your code and have full transparency.

    What’s also great is that you can use this component will work on both 3.x and 4.x iOS Versions. This way you can target the broadest possible audience with reaping the benefits of iAds if available.

    Adding advertising is exceedingly simple:

    #ifdef FREEVERSION	
    	[[DTBannerManager sharedManager] addAdsToViewController:tabBarController];
    #endif

    Then you can just subscribe to the notifications to adjust the viewing area of your view controllers.

    DTBannerManager is proving it’s worth already in GeoCorder [FREE]. There was a bug preventing “clicking through” in Ads that I have since fixed. The component is available through the Dr. Touch’s Parts Store.

  • DTCustomSwitch

    Posted on June 2nd, 2010 drops No comments

    I wanted to use a UISwitch in iWoman to select between Celsius and Fahrenheit for the temperature scale. UISwitch being in my humble opinion the quickest method to switch between two values. Unfortunately Apple does not give us any kind of customization capability.

    Homick tried to fill this need by making a custom view and providing a photoshop file that you could change. But that’s not how we do things in Dr. Touchistan. I totally revamped Homick’s code and brought it up to snuff to what I needed. Most importantly the color and labels needed to be fully customizable IN CODE.

    DTCustomSwitch is almost entirely written from ground up as a UIControl where you can customize the text and looks of of both labels as you please. Even set the background color. That so far fulfills my needs for iWoman 2.0, but if you have any ideas on how to even more customize it, let me know.

    Peter Steinberger informed me that you can also drag the knob for sort of a “slow switching”, something I had not thought about initially. But so I spent a couple of hours honing the animation behavior to get as close to the original as possible. Now DTCustomSwitch even does that.

    DTCustomSwitch will available via the Dr. Touch’s Parts Store for 50 Euros.

  • DTVideoEncoder

    Posted on April 13th, 2010 drops No comments

    I’ve been approached by several parties asking for a component to capture live video. I did my homework but had to find that without access to a hardware-based video encoder it is not possible to get real time frame rates on iPhones.

    Interviewing the maker of the ShowTime Video Recorder app for iPhone 2G and 3G enlightened me a bit as to what tricks they used to pull off their app. They use AVI containers for JPEG frames and PCM audio. Other people seem to have a bit of success with compiling FFMPEG on the iPhone. But generally MPEG4 does not use less CPU power than encoding JPEGs, it uses MORE, causing even worse frame rates for live video.

    And that’s ignoring the licensing problems you get when selling an app that has a h.264 encoder. A double-whammy in non-feasability for FFMPEG, all the more reason to find out the truth of the matter.

    So we set out to build DTVideoEncoder to see for ourselves what kind of performance we can get. Unfortunately it turns out that even on a 3GS we are getting a maximum frame rate of 5 frames per second when encoding live screenshots. Polar Bear Farm hinted that they are only able to get their performance (of around 6 fps) because of heavy assembly-optimizing the JPEG compression library . But they communicated a disinterest in licensing it for us to put into a sellable component.

    So we were stuck. Until actually somebody told us that instead of live video encoding he just wanted to add JPEG files to an AVI container plus audio. Because the JPEG files where already compressed  he would not face the bottleneck of JPEG compression. Suddenly this specific use case reinvigorated the project.

    Kris Harris – maker of the 8 Track Mind iPhone game – went back into the depths of the AVI documentation and polished up DTVideoEncoder to be usable for offline encoding and added the requested capability of adding an existing PCM audio file as soundtrack. Kris is a great developer and his code is awesome, I’m glad to have him on my Dr. Touch Core Team.

    Here’s a demonstration of the Demo app that you get with the component.

    DTVideoEncoder does not have any external dependencies. Because the external JPEG compression library did not yield any performance improvement over what’s built into the SDK we chose to go with the on-board method.

    Hours and hours worth of research and coding went into in this simple to use component to warrant a price tag of several hundred dollars. But because of the limited utility we we set the price to the lower end of the spectrum, at 250 Euros. It might enable one or more interesting uses of offline-video on iPhone or iPad.

    Here’s a demo video embedded in a HTML5 video tag. Safari plays it without problems.

  • DTLEDNumberView

    Posted on February 13th, 2010 drops 1 comment

    When experimenting with the iPhone’s built-in LED font I found it severely lacking in terms of usability. It’s designer has had the glorious  idea of not making all numbers the same size. This means that if you have any kind of changing label (like for example a digital clock) then the contents of the label will jump around as digits change size. This is especially annoying going from or to a one which is extra slim.

    Generally my instinct is to use regular smooth fonts for display of numbers, but I find that every 2 or 3 months I get into a situation where the classic LED look would be the perfect gimmick. For example I am still pondering how to make the UI of GeoCorder more attractive and one idea was to have the measurements be displayed in LED numbers.

    So I set out to create a reusable solution for this problem. A quick search on Google gave me this image from iStockphoto. It does have their watermark, but I was not going to simply off their images. Instead I used it as a template to construct a resolution-indendent drawRect for my DTLEDDigitView. The resolution was just big enough so that I could find the edges in my image editor and make the appropriate connections.

    Basically you cut out the 8 which has the best contrast on all sides and then you get the coordinates of each corner of each bar. To make it resolution-indendent you then multiply each value with a unit size for width and height so that this scales nicely. The main reason why I wanted it to be resolution-independent is that this will look nice very small but also on the many extra pixels that are available on the iPad. So if you use DTLEDNumberView you don’t have to worry about static LED number images being scaled into fuzzyness. My solution is always crisp.

    Then I added code to turn on and off single bars depending on the digit property. Also I wanted to be able to control the dot, so I added a property for that. Activated bars are paths filled with this distinct red, non-activated bars are 100% white with 30% alpha so they will lighten any background slightly. That’s all about the drawing.

    Very useful when creating custom views like this is to fill in the sizeThatFits method with some algorithm that will adjust the width and/or height accordingly. In this case I am using it to find a scaling where the aspect ration of the numbers still fits in.

    Then I took the DTLEDDigitView and made a view to add to itself as many such digits as a property numberOfDigits would decide. Optionally there is a property numberOfDecimalPlaces which decides how far from the right the comma is. The final touch is to have a value property and to adjust all the individual digits accordingly if it changes.

    Here’s my demonstration video, it simply adds PI every tenth of a second so that you see the numbers change, also behind the comma.

    I can immediately think of a number of useful customizations, like changing the colors for active and inactive and maybe adding a neon glow to the active bars. But for lack of a concrete application with it’s requirements I won’t fiddle around with it until there is one. I need either myself or somebody else to have an app to add this component to so that I know the final tidbits necessary.

    The whole thing took me about a day to make so I’ll set the introductory price at 50 Euros. If you’d like to use this technique in your own apps, drop me an e-mail so we can discuss what extra features you would require to make the purchase.

  • DTSplashExtender

    Posted on February 8th, 2010 drops No comments

    Typically you would use Default.png to show an empty user interface to reuse the subjective loading time of apps. This is especially true for productivity apps. Games are an example of the opposite. There you often see several splash screens with logos and copyright information. Between those extremes there are apps that use licensed materials and where it makes sense to briefly show such licensing information right at the start. The loading screen however is only showing for as long as the app needs to start up, which can be extremely short if the app is well coded and/or running on an iPhone 3GS.

    So out of the need to display the loading screen”a bit longer” resulted revelopment of DTSplashExtender.

    This new addition to my Dr. Touch Parts Store gives you this exact capability in a worry-free package. With this method you set a timeout of several seconds for which the Default.png is shown extra. You can have subsequent images that are faded to after the time has elapsed and show multiple pages with logos this way. When the show is over you dismiss the modal DTSplashExtender controller, your choice of flip, cross-dissolve or slide down.

    There are delegate methods that you can hook into in your app delegate to perform certain actions when a certain page is showing. Additionally you can enable a feature where tapping the screen ends the show or fades to the next page right away. For example you could show a button to prompt the user to accept your licensing terms. Let me know if you have special requirements.

    Here’s a quick demo:

  • DTCalendarViewController 2.0

    Posted on February 7th, 2010 drops No comments

    When I saw the demo video of Billings Touch it hit me like a cold snowball: it also makes sense to use a calendar to select a date. Billings Touch shows you a nice big calendar view when you select a project due date. Shortly thereafter there was a discussion on date pickers on my favorite forum and the result of this also pointed towards the necessity of having a real calendar replace UIDatePicker.

    So I sat down for 2 days straight to surgically remove the calendar-related parts from DTCalendarViewController and put those into their own class DTCalendarView. This enables you to use the view by itself. Also I put my secret sauce UIView+sliding into the project, as a free bonus. This category extension allows you to slide in any kind of UIView from the bottom of the screen. Together with DTCalendarView you get magic: a drop in UIDatePicker replacement!

    Additionally to the above new features there where a couple of minor bug fixes and programmability improvements that will make your life as developer much easier. The update for DTCalendarViewController is free of charge for existing customers. To order your access and license go to the Dr. Touch’s Parts Store today!

  • Dr. Touch’s Purchase Button

    Posted on February 3rd, 2010 drops No comments

    When you get around to adding In App Purchases (IAP) to your app you will find that Apple does not provide anything to help you with the UI. StoreKit only takes care of the buying backend. Therefore I sat down and spent many hours to construct a customizable purchase button to be the latest addition to the Dr. Touch Parts Store.

    DTPurchaseButton

    This is a button that has three states you need for In App Purchases: Neutral, Confirm and Purchased. For each of these states you can set a text and a title and the button does all the rest. It will send a message to your delegate when the button resizes so that you can move UI elements out of the way. It informs your app if a purchase should be made via StoreKit or whether it was cancelled. DTPurchase Button transmits an especially high value of your IAPs by  using a custom gloss finish.

    Have a look at this video demonstration of the part in action:

    Price: 100 EUR

    You can order this part for use in your own projects via e-mail. See the terms and conditions at the bottom of my store page for the fine print.

  • Dr. Touch’s incredible POI Weight Loss Formula

    Posted on January 22nd, 2010 drops No comments

    I’ve been busily hacking away on this for the past week and now I have reached the level where I can formally announce this new addition to Dr. Touch’s Parts Store.

    I was approached a week ago by somebody who suggest this to be sold as an inexpensive component and I immediately was intrigued by the problem. Imagine that you have an iPhone app which displays lots of PINs in a very restricted area. Naturally shops would be very close to each other causing the resulting annotation PINs to overlap. DTClusterMaker, the new component, aims to address this problem.

    Without it your screen might look like this:

    After a quick optimization with DTClusterMaker this mess turns into something much ligther, much nicer to look at:

    I hope that you agree that the second view would be the preferred variant. This way you can still see the name of the city in question: München (= Munich).

    DTClusterMaker employs a very efficient method to spatially sort and cluster closeby POIs. In the presented demonstration app you can explode any of the purple pins into it’s original POIs. You get two different algorithms to choose from: The perfect one, that tends to slow down if you feed it hundrets of POIs. And it’s ultra-fast cousin which works by “boxing” the POIs. It’s so fast in fact, that I am thinking of letting it run multiple times with a shifted grid and then choose the output that gives me the smallest number of POIs. If you have hundreds of POIs then you won’t see a difference.

    DTClusterMaker is available now for you to purchase at an introductory price of 100 Euros. It still needs a bit of work in getting the interface to your code ironed out, but as with all components your access to the SVN repository where it is being developed insures that you get all those improvements for free. Also I am depending on your requirements to figure out the most elegant way to interact with the ultimate POI weight loss formula. :-)

  • Dr. Touch’s Parts Store

    Posted on January 3rd, 2010 drops 2 comments

    UPDATE: This article was split into the announcement and the information about individual parts. The annoucement stayed in this article, but the individual parts’ description was moved to the Parts Store page.

    I like to reverse-engineer stuff because I learn much from how somebody else (like Apple) solved a UI problem. Most of the solutions I am coming up with are too big for a blog article, instead they found a home on my SVN. Generally when I demo my demos the reactions are entirely positive and I get flooded with requests to license those technologies.

    I am not yet entirely certain on how to best organize such an endeavor, but spontaneously I had a title for it spring up from the back of my head:  Dr. Touch’s Parts Store.

    Dr. Touch being my online brand, Parts referring to the components that I build to easy integration into a multitude of projects and Store as in “show me the money”. iPhone Development is my livelyhood and passion. So as much I would like to give away all, that’s not the reality I live in. My bank does not yet accept pro bono as legal payment.

    So, if you see something on this site or in my YouTube videos that you like to be able to use in your own apps, you can!

    By purchasing a source-level license to any of Dr. Touch’s Parts you gain access to my Subversion Repository where I am continuing development on parts as I am fixing bugs or implementing requested features.

    Here’s what I have to offer right off the bat. All these components are readily available to license. To order your access please contact me via e-mail. You will receive access and free implementation support.

    Go To Parts Store page.