Parts – Cocoanetics https://www.cocoanetics.com Our DNA is written in Swift Sun, 16 Mar 2014 19:53:43 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 39982308 Announcing BarCodeKit https://www.cocoanetics.com/2013/08/announcing-barcodekit/ https://www.cocoanetics.com/2013/08/announcing-barcodekit/#comments Mon, 19 Aug 2013 12:47:49 +0000 http://www.cocoanetics.com/?p=8569 iOS7 will have the ability to scan 1D and 2D bar codes built-in. The same is true for generating 2D bar codes. Which begs the question why Apple opted to omit support for creating 1D bar codes. (rdar://14694904)

One second hand explanation I heard was that laser-based scanners might have trouble reading 1D codes from the screen of an iPhone, whereas 2D codes require a camera anyway and therefore can be easily scanned even from a display.

While this explains the omission to a certain degree, I don’t buy it. I can think of many scenarios where you would want to print a 1D bar code, or put it into a PDF that is supposed to printed. Also, as CCD-based scanners become more prevalent they will soon be available in larger numbers than laser-based scanners.

In short, I am seeing a niche that is not being served. Thus I’m announcing BarCodeKit.

BarCodeKit is supposed to allow for generating 1D bar codes for whatever use you might have for them in your apps.

Of course there are other libraries. Jeff LaMarche famously created CocoaBarCodes, which was last updated in May 2009. As you can see from the code it is targeting OS X. There is NetShade’s fork of this with some improvements, but abandoned in January 2013, which a long to do list. There are several severe issues with these two projects, for the most part they are Mac-only. Netshade removed the caption printing capability to make it iOS compatible, but never fixed that. And it doesn’t do ARC. And it is in much need of a ground-up rewrite. And so much more …

I got the fork to run on my iOS device, but it didn’t even produce correct codes. This is where my research stopped.

So I decided to start BarCodeKit and structure the whole thing in a way that is easy to understand and extend. I like to re-invent the wheel wherever feasible if it teaches me something and the outcome is better than the original wheel. Better insofar as that it is using modern object-oriented technologies, ARC, is platform-independent and simply the only thing you want to use for the purpose.

What Works

At the time of this writing I have the most basic bar code types done. Those include the ones that are used to represent products codes on physical products. Code 39 I found in use on a Netgear product label where it specifies MAC-address, serial number and product code.

EAN-13 / UPC-A

EAN13 generated with BarCodeKit

EAN-8

EAN8 generated with BarCodeKit

UPC-E

UPC-E generated with BarCodeKit

Code39

Code39 generated with BarCodeKit

Project Structure

I structured the codes around individual “code characters” which are a pattern of bars described by a bit string. All characters derive some basic functionality from BCKCodeCharacter. All codes share BCKCode as root.

BarCodeKit Project Structure

All characters know what pattern of bits (1 for bar, 0 for space) is representing them. This enables all drawing to be BCKCode.

From implementing what we got so far I learned that there are several different things people might want to customize for output of their bars. Because of this I didn’t implement a fixed way to draw them, but allow the user to pass rendering options. The codes are model objects and don’t deal with views, instead they have a method sizeWithOptions: and renderInContext:options: that allows you either provide a PDF or a bitmap context to draw the bar code into.

For example to create a bitmap of code you would use this code, provided in UIImage (BarCodeKit) category.

+ (UIImage *)imageWithBarCode:(BCKCode *)barCode options:(NSDictionary *)options
{
   CGSize neededSize = [barCode sizeWithRenderOptions:options];
 
   UIGraphicsBeginImageContextWithOptions(neededSize, NO, 0);
   CGContextRef context = UIGraphicsGetCurrentContext();
 
   [barCode renderInContext:context options:options];
 
   UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
   UIGraphicsEndImageContext();
 
   return image;
}

The reason for this approach is that typically a size of the output bar code is related to the width of the bars. If you make the bar width thicker, then whole code would grow in required size. If you want a larger bitmap you would increase the bar width multiplier. Also the EAN variants typically have a standard aspect ratio which increases the needed size, whereas Code 39 you normally want to have with a fixed height.

So far these options are implemented:

  • BCKCodeDrawingBarScaleOption: Multiplier for the bar width (default 1)
  • BCKCodeDrawingPrintCaptionOption: Whether the code caption should be printed (default NO)
  • BCKCodeDrawingMarkerBarsOverlapCaptionPercentOption: How many percent of the caption height are covered by elongated marker bars (default 1.0)
  • BCKCodeDrawingFillEmptyQuietZonesOption: Whether quiet zones should be filled with angle brackes (default NO)
  • BCKCodeDrawingDebugOption: Whether the caption areas should be tinted for debugging (default NO)

As time goes one I am certain that additional options will become necessary, like to set a fixed bar height or specify colors. Those will depend on the use cases that developers will want to use it for.

How to Use

BarCodeKit is very simple to implement. You create an instance of the code you want to generate and then call the above mentioned category method.

NSDictionary *options = @{BCKCodeDrawingBarScaleOption: @(2)};
BCKEAN13Code *code = [[BCKEAN13Code alloc] initWithContent:@"9780596516178"];
imageView.image = [UIImage imageWithBarCode:code options:options];

Of course there are many more things to do with this, like to add proper unit tests and additional codes, like Code128. But again, those will have to largely depend on public interest in this framework.

I have implemented a simple demo app which lets you play with some of the options to see their effect.

BarCodeKit Demo App

As work progresses on BarCodeKit this might change quite a bit, to accommodate additional codes and code-specific options.

Update: Documentation is now available.

The Future

In the near term future BarCodeKit will remain closed-source to preserve the competitive advantage that it provides to people who are willing to spend a little money on acquiring a license. Introductory price will be 150 Euros, which will give you full access to the private git repository where it is being developed.

If you are interested in adding features (i.e. additional bar codes) I would waive the fee in exchange for your contributions. It largly depends on the interest of the community in which direction this project will evolve. We will see, however for now I need to make a little bit of money with it.

Either way, please contact me if you have a project that would benefit of BarCodeKit.

]]>
https://www.cocoanetics.com/2013/08/announcing-barcodekit/feed/ 20 8569
Ziner is using DTCoreText https://www.cocoanetics.com/2012/11/ziner-is-using-dtcoretext/ https://www.cocoanetics.com/2012/11/ziner-is-using-dtcoretext/#comments Sat, 10 Nov 2012 18:56:13 +0000 http://www.cocoanetics.com/?p=7220 The developer of an upcoming Google Reader client wanted to share the following with me, and – with his permission – also with you dear reader.

I’m Jay Zhao, the developer of Ziner and I’m very happy to tell you that DTCoreText is great!  Thank you for writing such a great library!

Ziner uses DTCoreText everywhere!

DTCoreText is my open source solution for parsing HTML and rendering attributed text from it. Built on top of it is my commercial component for rich text editing DTRichTextEditor.

Jay Zhao continues:

Ziner is a Google Reader client for iPad. Yes, another Google Reader client, but Ziner is much faster and more beautiful. You can smoothly scroll through articles as fast as you can without encounting any lag. Tested by myself, Ziner is  faster than Reeder, Flipboard, Zite, Google Currents, Feedly, Pluse and probably anything else that uses UIWebView.

During the early days of developing, I was searching for a way to render RSS articles. I tried UIWebView, but It was slow and its memory footprint was huge. Then I found DTCoreText, which is much faster than UIWebView. And because the HTML usage of RSS feeds are often very simple,  DTCoreText fits perfectly in rendering RSS feeds.

Ziner is now in its Beta stage (going to be released at the end of this month) and you can get it here http://tflig.ht/NNKr8t to try it out, I’ll be honoured to have you as a Beta tester!

Thank you again Oliver Drobnik! Without DTCoreText, Ziner will be impossible, hats off to you!

Jay Zhao.
Developer of Ziner.

Pictures of Ziner. All rendered by DTCoreText!

]]>
https://www.cocoanetics.com/2012/11/ziner-is-using-dtcoretext/feed/ 1 7220
Time-Limited Demo of Our Components https://www.cocoanetics.com/2012/08/time-limited-demo-of-our-components/ https://www.cocoanetics.com/2012/08/time-limited-demo-of-our-components/#comments Tue, 21 Aug 2012 08:37:06 +0000 http://www.cocoanetics.com/?p=6900 I’m happy to announce today that we will begin to make available test versions of our components so that you can try them out in your apps. This is possible with the help of our Jenkins build server which installs a “time bomb” on every nightly build of the components. This limits the utility of the static universal frameworks to 30 days of testing. Of course you can download a new copy as often as you like to further extend the testing time. But you cannot publish any production apps with that.

Our best-selling component is DTRichTextEditor and also by far the most complex because of the multiple sub-projects. Here’s a guide how to get set up for evaluating the component.

There is a DTRichTextEditorDemo host project available on GitHub. Except for the framework – which we still need to download – this is a fully functioning app.

Download a fresh copy of  http://beta.cocoanetics.com/demo/DTRichTextEditor.embeddedframework.zip and unzip it.

This is an embedded framework because of the DTLoupe.bundle which contains the resources for the magifying glass. The framework itself is also contained in there. The reason for this is that you simply drag the embeddedframework folder into Xcode and it does the right things with what it finds. The resources will be copied to the app bundle, the static universal library will be linked into your app binary.

So you drag the folder into your project.

You want to copy all files into your project folder as well as assign them to the target.

This action achieves several things at the same time:

  • Copies the library and bundle into the project tree
  • Adds the bundle to the “Copy Bundle Resources” build phase
  • Adds the library to the “Link Binary with Libraries” build phase
  • Adds “$(SRCROOT)/DTRichTextEditor.embeddedframework” to the “Framework Search Paths” build setting

We do not need to set up any additional header search paths because all headers required can be found inside the framework’s headers folder.

Finally, I recommend adding the import for the global DTRichTextEditor.h to the PCH file like so:

#ifdef __OBJC__
   #import <UIKit/UIKit.h>
   #import <Foundation/Foundation.h>
   #import <DTRichTextEditor/DTRichTextEditor.h>
#endif

That’s all it takes. (I hope) The Demo is set up to add some rich Hello World text.

Due to the amount of buttons added to the toolbar I made it iPad-only for now so that I didn’t have to invent a user interface suitable for iPhones, too. B, I, U, H are Bold, Italic, Underlined and Highlighted. L,C, R, J are Left-, Center-, Right-aligned and Justified paragraph styles. The 1. and + are an incomplete implementation of list-support. The photo inserts a picture from the photo album. The smiley button inserts an inline smiley graphic. And the URL button shows how to turn some text into a hyperlink.

I am happy to accept your pull requests for nicer UI in exchange for discounts on the component. I’m especially looking for a font picker and style popup like Apple has it in Pages for iOS. 🙂

Conclusion

With this guide and by looking at the demo project you should be able to evaluate the component in the context of your own apps. Then when you’re ready to purchase a full license you simply remove the framework and replace it with the original source code as a sub-project. Now that I have figured out the process end-to-end I will make more and more components available this way.

Let me know if you have any preference which components I should make available as time-limited demo next. Otherwise I’ll approach them by number of recent sales.

]]>
https://www.cocoanetics.com/2012/08/time-limited-demo-of-our-components/feed/ 30 6900
DTRichTextEditor / DTCoreText News https://www.cocoanetics.com/2012/02/dtrichtexteditor-dtcoretext-news/ https://www.cocoanetics.com/2012/02/dtrichtexteditor-dtcoretext-news/#comments Wed, 08 Feb 2012 14:07:46 +0000 http://www.cocoanetics.com/?p=5929 You might have noticed – if you follow the DTCoreText project on GitHub – that I made many changes on this Open Source project. The most recent change was that somebody donated a CocoaPods spec for the project and thus forced me to give it a version number. The reason being that pods are usually pointing to a specific tag in a GitHub repository. This way people using the project via CocoaPods can be certain that they are getting a stable version.

So I stumbled into this, but when trying to think of a good version number I could only come up with “1.0.0”. DTCoreText has matured sufficiently to call it that. Hey, earlier versions made it into quite a few popular apps, including Float. There are tons of performance improvements, additional features and most importantly the parser has been replaced with libxml2. This makes it both faster and able to deal with any kind of HTML you throw at it.

DTCoreText has two parts: first it creates NSAttributedString instances from HTML, second it displays these properly. CATextLayer would be able to take attributed strings, but it ignores paragraph attributes and cannot draw images. DTCoreText  has an ingenious mechanism where you can supply your own UIViews for each attachment.

Attachments can be generic <object>s, <video>s or even <img>. DTCoreText takes care of the drawing and leaving some space and then tells you precisely the size you need to provide for your image views. Of course, if you don’t need any special treatments then images can also be drawn together with the text.

What is the connection between DTCoreText and DTRichTextEditor?

To make up a rich text editor you need multiple parts which are all in separate projects.

DTRichTextEditor is being sold for €500 and includes DTLoupeView priced at €150. You can also purchase the Loupe separately if you don’t want to full text editing, but just the magnifier.

DTWebArchive and DTCoreText are Open Source projects which you can use at no charge, provided that you credit Cocoanetics as authors. You can purchase Non-Attribution Licenses for €75 a piece so that you don’t have to mention us.

Several people have asked me about the exact terms of these Non-Attribution Licenses. I introduced these as a way for developers to sponsor the ongoing development in exchange for not having to mention Cocoanetics in the app. You get a clear conscience and the good feeling to have supported something that saved you hours and hours of work. You get an invoice for your accountant so you can even expense this payment.

But I have no way of checking if you do adhere to the terms, or if you use the components without attributing them properly. Hey, it is YOUR KARMA. If my Open Source projects save you a single hour of development time, then the investment in this license should be easily worth it.

Of course I would be over the moon if somebody told me that he wanted to purchase 12 such licenses for 12 of his clients. Hey, do what you feel that is fair, ok?

If you do the math you’ll find that this is indeed a bargain:

DTCoreText … €75
DTWebArchive … €75
DTLoupeView … €150
DTRichTextEditor … €200

Something that you cannot get elsewhere … €500

Actually that gets me thinking, I should maybe increase the prices. I just convinced myself that this is all way too cheap…

DTRichTextEditor Updated, Too

Now with DTCoreText gone gold I also updated DTRichTextEditor to include all these great advances. The project too comes with a Demo app that shows how to interact with the component as well as demonstrates how to integrate the editor. The above mentioned components are sub-projects of this with the two Open Source ones being a clone of the GitHub repo on my Subversion server.

Technically the demo (or your own app for that matter) only needs to link in the libDTRichTextEditor static library and copy the DTLoupe.bundle (containing the loupe images) into the app bundle. If you inspect the Demo settings you see how this is done.

It is generally wise to add the items you need to the dependencies so that Xcode will know to refresh these if they are modified. In the linked libraries you see a heap of Apple frameworks and that we link in libxml2 as well as the static libDTRichTextEditor which aggregates the objects from the other three projects into one convenient library.

HINT: There is one (non-obvious) maneuver you have to know to be able to get a resource bundle created in a sub-project in the list of bundle resources. You need to expand the sub-project so that you can see the products group (yellow folder). Then choose the project root to see the targets. Finally drag the bundle product from the sub-project into the “Copy Bundle Resources”. Xcode is smart enough to know where to copy the product from.

With the above setup Xcode will build all necessary parts for the one or two necessary architectures and merge it all together nicely. For further tips regarding what you need to know when using Sub-Projects refer to my earlier article on Sub-Projects and Header Magic.

Conclusion

I happen to like the concept of self-contained pieces very much and what I learned over the past few weeks of how to do it right enabled me to use them in a large scale component as DTRichTextEditor, bringing together multiple bits and pieces.

Of course development will go on, mostly on the Open Source elements. And there are several items still missing that I am guilty of procrastinating. I want  to provide a time-limited binary version of the framework for testing and evaluation. There are many items on the to do list for DTCoreText itself. I need a better quick start guide to do justice to the dozens of users who are funding the development efforts. And there really should be some AppleDoc-style documentation.

While I do like writing, I don’t like writing documentation as much. So I’ll do that when I get around to it… 😉

]]>
https://www.cocoanetics.com/2012/02/dtrichtexteditor-dtcoretext-news/feed/ 3 5929
Component Development Contest https://www.cocoanetics.com/2011/10/component-development-contest/ https://www.cocoanetics.com/2011/10/component-development-contest/#respond Fri, 28 Oct 2011 08:56:37 +0000 http://www.cocoanetics.com/?p=5623 Component Marketplace BinPress announced a development contest for mobile components, running through November 26th. The top three spots are rewarded with $20,000 in cash and prizes.

The judging period will run for 14 days after the end of the contest, and I’m happy to announce that I was approached to be one of 4 judges. So you don’t have to worry about competing against me! 🙂

Of course that does not mean that flattery will get you anywhere, just because you know me.

Entries will be judged based on the following three criteria:

  1. Development style and methodology – intelligent use of software design techniques and patterns. This includes but not limited to separation of concerns, encapsulation and abstraction, loose-coupling, readability and maintainability;
  2. Originality – how original is the submission. Creativity and originality can compensate for less mature code. On the flip side – if the submission is in a crowded space, the code level needs to be at the highest possible in order to compete.
  3. Usefulness – how useful is the submission. Creativity is important, but the package must also be useful in the real world. Very useful packages will be graded higher.

There are some ideas for components on the site, as well as the complete rules and regulations. Good Luck!

]]>
https://www.cocoanetics.com/2011/10/component-development-contest/feed/ 0 5623
Announcing Rich Text Editing for Everybody https://www.cocoanetics.com/2011/08/announcing-rich-text-editing-for-everybody/ https://www.cocoanetics.com/2011/08/announcing-rich-text-editing-for-everybody/#comments Mon, 01 Aug 2011 10:11:23 +0000 http://www.cocoanetics.com/?p=5299 Today we’re announcing the accelerated availability program for DTRichTextEditorView a view that combines the richness of NSAttributedString+HTML with UITextInput to give you the editing capabilities you need to change text editing on iOS forever.

The component has reached a status where it actually makes sense to have people start implementing it in prototypes and BETAs of their apps to gather the necessary feedback for polishing the API and find out features that are missing to allow for your special use cases to work with that as well. That final stage should be concluding before the end of August 2011.

Find out what features are already implemented, which ones are still missing and how you can get your hands on it today.

These are the currently implemented features and what is still not in there:

  • set the contents of the editor view either from an NSAttributedString or HTML
  • move cursor by long pressing, circular loupe
  • move selection handles by long pressing or dragging them, rectangular loupe
  • change selection with hardware keyboard, cursor keys and change selection holding Shift
  • enter text via on-screen or hardware keyboard
  • support for entering text that requires marking, e.g. japanese characters
  • support for adding images either inline or in their own paragraph
  • Auto-Completion implemented (where it suggests a word while you are typing)
  • Auto-Correction – NOT YET  (where a suspected misspelled word has a red dotted underline)
  • Toggling of bold, italic and underlined
  • Your own custom views over links, videos or images
  • Scrolling capability, the editor is a UIScrollView subclass that does not override the delegate
  • Pasteboard, cut/copy/paste plain text, post NSURL or UIImage. NOT YET: copy rich text to and from the component, because there is no native format
  • Context menu. TO ADD: support for your own menu items to show up after selecting text

Here is a video demo that I made some time ago. The component has progressed quite a bit since then, but this shows you the basic features.

//www.youtube.com/watch?v=JDvdzoeCTuw

I wouldn’t try to use this for very long documents yet because there some work still remains to do partial lay outing of an attributed string and merging the results into an existing display. But for most regular use cases it should work well.

For your purchase price of 500 Euros you get unlimited access to the SVN repo where the component is being developed and you can start implementing it right away. I will be working with you to iron out any problems that might be remaining. There is already one pilot app that’s being developed with this pre-release version, but it is now necessary to include more developers for the stated reasons as well as financing the continued development.

To order, send me an e-mail with your invoice address. As usual I will be sending you a PDF invoice and after payment (PayPal or bank transfer) you will immediately get access to the component and demo app. Note that EU companies need to provide a VAT ID. Private persons have to be charged 20% VAT on top of the purchase price.

]]>
https://www.cocoanetics.com/2011/08/announcing-rich-text-editing-for-everybody/feed/ 4 5299
NovelRank App Shows Off DTChartView https://www.cocoanetics.com/2011/07/novelrank-app-shows-off-dtchartview/ https://www.cocoanetics.com/2011/07/novelrank-app-shows-off-dtchartview/#comments Wed, 06 Jul 2011 19:26:52 +0000 http://www.cocoanetics.com/?p=5241 Similar to us developers who keep scouring  sales rank information on sites like Applyzer there is a service for book authors. It goes by the name NovelRank and it lets authors track their book sales on Amazon.com.

Dave Wooldrige from Electric Butterfly (also a renowned book author in the iOS sphere) took it upon himself to create a beautiful iPhone client for the NovelRank service and released this just today, for FREE.

I’m specifically mentioning this here on my blog because Dave implemented my DTChartView component to get interactive scrollable charts for the ranking data.

Dave needed what only DTChartView could offer: endless scrollable charts that he could adapt to the app’s unique style. It should integrate, not stick out like a sore thumb.

See for yourself, don’t they look beautiful?

In his own words, Dave describes the convenience of getting my component for this task:

Thanks for making DTChartView! It definitely saved me a lot of development time!  🙂
– Dave Wooldridge

This is the third major app making use of this part, the first one being Baby Bubbles and the second HandyEtat. Here are a couple more screen shots, all showing a customized DTChartView. The top view is the default look, the bottom one shows some customization.

DTChartView can do line charts, bar charts and charts with stacked bars, you can adjust the line colors, fill the area above and below the line with different gradients and you even get touch handling for when you want to show data point details via tapping.

Contrary to other chart components this one is meant to show a horizontally scrollable chart that gets dynamically drawn as your scroll, all super-smooth. This works because drawing is done on a CATiledLayer. You feed it by implementing a couple of delegate methods and you’re done!

]]>
https://www.cocoanetics.com/2011/07/novelrank-app-shows-off-dtchartview/feed/ 2 5241
DTLoupe – Reverse-engineering Apple’s Loupes https://www.cocoanetics.com/2011/06/dtloupe-reverse-engineering-apples-loupes/ https://www.cocoanetics.com/2011/06/dtloupe-reverse-engineering-apples-loupes/#comments Fri, 24 Jun 2011 17:09:10 +0000 http://www.cocoanetics.com/?p=5216 I am working on a CoreText-based rich text editor at the moment. That means employing two primary technologies: the UITextInput protocol as well as rendering the formatted text with CoreText. Unfortunately Apple has forgotten to add selection and loupe mechanics to UITextInput, so we have to build these ourselves if we want to get the same look&feel as the built-in stuff.

So to get the selection handling and loupe we see developers go two paths: either they distort UIWebView with fancy JavaScript or they struggle with implementing their own code. These approaches lead to a wide variety of differently looking and behaving loupes and selection mechanics. I have contacted Apple by all means available to me and I’m hoping that there will be an official method to get the selection mechanics and loupe down the road.

But until there is, I let me present an interim solution for this problem. This will be a component I call DTLoupe and it have many potential applications besides being used in an editor to select text. Like providing a magnifier in a context when pinch-to-zoom does not make sense.

Apple’s loupe consists of several parts that are combined with a zoomed rendering of the view around your finger. The layers bottom to top are:

  • a “lo” image forms the base
  • a mask masks the inner shape of the loupe
  • a 1.25x enlarged rendering of the view is put into this space
  • a “high” image adds the shine and general frame

Apple seems to prefer use of a masking image over a clipping path. We believe this to be the case because masking is probably much faster than clipping because it can be entirely done on the GPU, being essentially a pixel-by-pixel operation, whereas with clipping there needs to be some extra logic to decide whether a pixel is still in the permitted area or not.

Quite a bit of experimentation was necessary to get it looking right, including the showing and hiding animation. Thankfully there is an amazing project on GitHub UIKit-Artwork-Extractor that helped us learn about “how they did it” by letting us inspect the images that are part of the whole effect. A note at the side, Apple is extensively using PNGs for all sorts of UI elements, so you might want to do the same, especially if you have a designer that can provide all these individual items for you to assemble.

My friend Michael Kaye was hard at work to research all the nuts and bolts and the result is coming along very nicely. There are a couple of other projects that provided some inspiration, like the OmniGroup framework. If you ask me now “why did you re-invent the wheel if OmniUI already has a loupe?” the answer is simple: it does not look like and does not behave like the original. And on top of that they never updated their solution for retina displays, which makes it impossible to use in a modern project where Retina-support is a must-have.

Now for the demo:

//www.youtube.com/watch?v=4L2IE2YD1wg

Work is ongoing to polish but I just had show off the fabulous work that Michael did over the past few days. Next up is actually hooking up the touch handling for moving the cursor, extending the selection and handling the context menu.

 

]]>
https://www.cocoanetics.com/2011/06/dtloupe-reverse-engineering-apples-loupes/feed/ 6 5216
App Shoutout for May https://www.cocoanetics.com/2011/05/app-shoutout-for-may/ https://www.cocoanetics.com/2011/05/app-shoutout-for-may/#respond Mon, 30 May 2011 22:22:07 +0000 http://www.cocoanetics.com/?p=5132 Every once in a while (monthly?) I like to give a shout out to apps that are making good use of components that came from my store.

If you have any released app that I have not mentioned so far, let me know, but please only if you are allowed to do so. I hate receiving mails with information that I cannot publish.

]]>
https://www.cocoanetics.com/2011/05/app-shoutout-for-may/feed/ 0 5132
DTCards – Universalizing an iPhone App https://www.cocoanetics.com/2011/01/dtcards-universalizing-an-iphone-app/ https://www.cocoanetics.com/2011/01/dtcards-universalizing-an-iphone-app/#comments Sat, 29 Jan 2011 13:13:36 +0000 http://www.cocoanetics.com/?p=4673 Ever since the iPad came out I’ve been giving the occasional thought as to how I could universalize my existing iPhone apps. Generally the problem is that you have view controllers that work well on the resolution of the iPhone, but if you simply display them full screen on iPad they look weird.

So I’ve started to work on a view controller that would allow me to reuse my iPhone view controllers by displaying them not in full screen but as distinct cards. The idea is that you would use the same DTCardsViewController as root in your app and then depending on which device it runs on will either show the cards filling the iPhone screen or by laying them out to better fill the iPad screen.

In this article I want to give you a brief demo of where my R&D stands so far.

For the first phase I decided to keep things simple and just have a method to push a card – in the form of a view controller – onto the scrolling table. Optionally each card can have a second view controller to control the backside. Cards would flip to reveal their backside.

On iPad the cards get a black border and rounded corners, via this method:

@implementation UIView (Cards)
 
- (void)addRoundedCornersToCardWithRadius:(CGFloat)radius
{
	CALayer *layer = self.layer;
	layer.borderColor = [UIColor blackColor].CGColor;
	layer.borderWidth = 1.0;
	layer.cornerRadius = radius;
	layer.masksToBounds = YES;
	self.clipsToBounds = YES;
}
 
@end

The cards view controller knows how to keep track of which card is centermost and if you rotate the iPad it will center on this card. If the user pinches open on a card, then this the view controller will move to closeup mode sliding out the neighboring cards. Here you could enhance the interface by enlarging image views or adding additional details for which there was no space on the 1:1 view. Pinch-Close goes back to the stream of cards.

Have a look at this YouTube video where I demonstrate the working technology so far. Sorry if there’s no audio, that’s entirely YouTube’s fault.

I don’t quite know what the best user interactions would be, so if you have some ideas please share them in the comments. Do you know any scenario that would benefit from such a dual universal view controller?

]]>
https://www.cocoanetics.com/2011/01/dtcards-universalizing-an-iphone-app/feed/ 4 4673
Rich Text Editing on iOS https://www.cocoanetics.com/2011/01/rich-text-editing-on-ios/ https://www.cocoanetics.com/2011/01/rich-text-editing-on-ios/#comments Tue, 25 Jan 2011 21:33:16 +0000 http://www.cocoanetics.com/?p=4659 For the past few days you’ve see me go on and on about this Open Source Project of mine. Sorry if this got a bit annoying to you but I am very passionate about bringing this functionality to a broad audience because I feel that UIWebView should not be used as much as it is. With the DTAttributedTextView from the GitHub project you can replace most of these and have way more control over the outcome.

Apple might finally add support for Rich Text Editing in iOS 5, coming Summer 2011. I suspect that the Pages app on the iPad might be a glorified test case for Apple for that. But even if that indeed comes to our Xcode, it will be end of 2011 that customers will have widely deployed iOS 5

.

Today I want to show you something completely different that is using the aforementioned project as a base and extends it to provide Rich Text Editing capability.

40 Required Protocol Methods

So I investigated a little bit and found that since 3.2 Apple is exposing the editing protocols to build our own text editing views.

UITextInput – the main editing protocol with about 40 methods in total that you need to implement

UIKeyInput – on this UITextInput is based, it has only 3 methods allowing you to add basic single key input to views

UITextInputTraits – several properties that allow to customize behavior like capitalization and autocorrection

An editing view must implement the above protocols, be able to becomeFirstResponder and have userInteraction enabled.

You have to implement your own UITextRange and UITextPosition subclasses because different editors might have different values symbolize a certain position or range in a document. The example given is that an HTML document might  have a position in the visible text as well as a position in the HTML code.

CoreText now Objective

To make it easier on myself I encapsulated CoreText in Objective-C, you find these classes prefixed DTCoreText in the Open Source project. I found it very effective to have both the HTML project as well as my editor project open side by side so that it does not matter where I am making modifications to the display classes. And also the HTML project is benefitting from utility methods that I am adding to DTCoreText.

In the HTML project demo there’s now a “Debug Frames” button that lets you toggle showing of all the individual layout elements that CoreText is using: frame, baseline, lines and glyph runs. Characters that have the same attributes make up a glyph run, they alternate in red and green shading.

Because you can add any kind of UIView to the DTAttributedContentView as a response to a glyph run you can also do something that you could not do with a web view before: add your own custom views, surrounded by HTML. No longer do you need javascript or Flash to achieve interactive rich text…. Think of the possibilities, you can now place an object tag in the HTML and then within your app replace this object tag with a fancy interactive view. Or something as simple as an SVG image rendered by another open source component, like SVGQuartzRenderer, SVGKit or CKSVG.

DTRichTextEditorView is a subclass of DTAttributedTextView adding all the required methods mentioned above. And then some. For example I also have a blinking cursor view.

Working so far are:

  • Cursor Movements
  • Positioning the cursor via tap
  • if you enter text it gets the same formatting as the text where it is inserted
  • if the cursor is scrolled offscreen then entering text scrolls it into the visible area

Still missing:

  • Autocorrection already works, but I am still wrestling with getting the rectangle for the selection. There might be a bug on the Retina iPhone simulator not taking into account the scale factor.
  • Selecting/Marking Ranges
  • Pasteboard Integration: Cut, Copy, Paste

I’ve recorded a video to show off some cool features from the Open Source project and also give a tech preview of DTRichTextEditorView. The demo is still missing some sort of format chooser, in the least some buttons to change font and make it bold or italic. But these are simple to add and I will do so once I tackled the harder problems.

In the end another interesting question will be how to get HTML back from an NSAttributedString. There are multiple options thinkable. Either you preserve the original HTML and have the editor edit both the NSAttributedString as well as an underlying HTML DOM. Or you generate HTML code from the NSAttributedString.

Does it blend?

It is my goal with this component to have it be super-easy to implement and allow to super-charge any app that has some sort of editing capability. The possibilities are limitless:

  • Apps to post to blogs or social media
  • HTML editors
  • Note taking apps to allow for highlighting sections and make words bold and italic
  • E-Mail apps that allow you to use stationary, signatures and rich text
  • Twitter clients which make links, usernames and hash tags not just clickable but interactive.

What are your ideas? Got any apps that could use a “Rich Upgrade?”

If you can think of any good use for this component then you have three options. You can be an early adopter and purchase this component at an early adopter BETA preview rate. If you cannot afford the cost for this, then I am open to suggestions for partnerships. You bring the app, I bring the component and we split the profits. Or if you are looking to do a free app then I might be open for supplying the component if the app has a large enough audience.

I am very interested to hear your feedback to this article and the tech demo video.

]]>
https://www.cocoanetics.com/2011/01/rich-text-editing-on-ios/feed/ 13 4659
DTBannerManager 1.3 https://www.cocoanetics.com/2010/10/dtbannermanager-1-3/ https://www.cocoanetics.com/2010/10/dtbannermanager-1-3/#respond Thu, 07 Oct 2010 17:25:26 +0000 http://www.drobnik.com/touch/?p=3081 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:

//www.youtube.com/watch?v=RNKRnbJY_qU

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

]]>
https://www.cocoanetics.com/2010/10/dtbannermanager-1-3/feed/ 0 3081
DTChartView 2.0 https://www.cocoanetics.com/2010/09/dtchartview-2-0/ https://www.cocoanetics.com/2010/09/dtchartview-2-0/#comments Mon, 20 Sep 2010 13:11:18 +0000 http://www.drobnik.com/touch/?p=3052 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.

]]>
https://www.cocoanetics.com/2010/09/dtchartview-2-0/feed/ 1 3052
Augmented Reality Plane Finder Trumps Charts https://www.cocoanetics.com/2010/09/augmented-reality-plane-finder-trumps-charts/ https://www.cocoanetics.com/2010/09/augmented-reality-plane-finder-trumps-charts/#respond Sat, 18 Sep 2010 10:20:24 +0000 http://www.drobnik.com/touch/?p=3046 Pinkfroot is a small iOS dev shop in the UK who specializes on apps that show planes and ships on maps. I had the author Lee Armstrong on my podcast a while back explaining how they are getting the vehicle telemetry. Increasing numbers of airlines and ships are outfitting their vehicles with transponders that are transmitting data like current speed or destination and there are boatloads of volunteers worldwide who have receivers for these airwaves and share them with Pinkfroot.

They had already used my DTAugmentedRealityController part with a bit of success on a Shipfinder app Ships Ahoy!, but naturally this is only interesting for people who at least sometimes have water nearby to gaze at ships on. Most of us iPhone users are living inland and so for every ship we see, there are dozens of planes that pass over our heads.

Enter Plane Finder AR. For the first time there is an Augmented Reality app where it actually makes sense to point your iPhone at something and get augmented data for what you are looking at. Granted there are apps showing you names of mountain peaks, but – honestly – those don’t move so much and thus are way less interesting as something that happens to pass over you right now.

Plane Finder AR gives you a rotating mini map and labels for the individual planes. These tell you the designations of the planes, ground speed, altitude, origin and destination, and distance from you. It proves to be a great use case for my AR component. If you have the data (the more live the better) you can easily build an enticing app.

Just how enticing? Well, let’s check the charts (courtesy of Applyzer)

The audience is downloading this app more than the likes of Tom Tom or CoPilot who had been leading the Navigation Category. Which in my humble opinion makes perfect sense because while navigation is something that you might use every once in a while when driving somewhere, this app makes the air above your current location a more interesting place.

]]>
https://www.cocoanetics.com/2010/09/augmented-reality-plane-finder-trumps-charts/feed/ 0 3046
DTBannerManager https://www.cocoanetics.com/2010/08/dtbannermanager/ https://www.cocoanetics.com/2010/08/dtbannermanager/#comments Fri, 06 Aug 2010 12:42:37 +0000 http://www.drobnik.com/touch/?p=2949 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.

]]>
https://www.cocoanetics.com/2010/08/dtbannermanager/feed/ 1 2949
DTCustomSwitch https://www.cocoanetics.com/2010/06/dtcustomswitch/ https://www.cocoanetics.com/2010/06/dtcustomswitch/#respond Wed, 02 Jun 2010 21:41:02 +0000 http://www.drobnik.com/touch/?p=2631 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.

]]>
https://www.cocoanetics.com/2010/06/dtcustomswitch/feed/ 0 2631
DTVideoEncoder https://www.cocoanetics.com/2010/04/dtvideoencoder/ https://www.cocoanetics.com/2010/04/dtvideoencoder/#respond Tue, 13 Apr 2010 08:07:58 +0000 http://www.drobnik.com/touch/?p=2421 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.

]]>
https://www.cocoanetics.com/2010/04/dtvideoencoder/feed/ 0 2421
DTLEDNumberView https://www.cocoanetics.com/2010/02/dtlednumberview/ https://www.cocoanetics.com/2010/02/dtlednumberview/#respond Sat, 13 Feb 2010 09:51:26 +0000 http://www.drobnik.com/touch/?p=2037 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.

]]>
https://www.cocoanetics.com/2010/02/dtlednumberview/feed/ 0 2037
DTSplashExtender https://www.cocoanetics.com/2010/02/dtsplashextender/ https://www.cocoanetics.com/2010/02/dtsplashextender/#respond Mon, 08 Feb 2010 09:08:56 +0000 http://www.drobnik.com/touch/?p=1985 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:

]]>
https://www.cocoanetics.com/2010/02/dtsplashextender/feed/ 0 1985
DTCalendarView 2.0 https://www.cocoanetics.com/2010/02/dtcalendarviewcontroller-2-0/ https://www.cocoanetics.com/2010/02/dtcalendarviewcontroller-2-0/#comments Sun, 07 Feb 2010 13:53:44 +0000 http://www.drobnik.com/touch/?p=1981 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!

]]>
https://www.cocoanetics.com/2010/02/dtcalendarviewcontroller-2-0/feed/ 1 1981