Blog

All Blog Posts  |  Next Post  |  Previous Post

TMS iCL: an introduction

Friday, June 7, 2013

In this article, we'll try to explain what TMS iCL is, what it isn't and why it can matter for your Delphi applications for iOS.


What is TMS iCL?
TMS iCL is a component library. It stands for iOS Component Library. It is a Delphi component library and as such, it is accessible as Delphi objects with properties, methods, events. The components are in fact wrappers around the iOS operating system level defined controls, for now mostly visual controls. In iOS Objective C terminology, UIView types. In this respect it is very similar to the Delphi VCL standard components like TEdit, TButton, TListbox ... etc. These VCL controls are tiny wrappers around the Windows operating system controls like EDIT, BUTTON, LISTBOX ... These standard Delphi controls do not do much more than present the Windows user interface controls as Delphi classes with properties, method and events. In the case of TMS iCL, these controls are usable from a FireMonkey form, just like VCL controls are usable from a standard VCL form.

How is an iCL control different from a FireMonkey control?
As iCL controls wrap iOS operating system controls, the entire look & feel as well as feature set of the iCL control is defined by what the iOS control offers. As such, TMS iCL controls are not style-able FireMonkey controls. In fact, an iCL control has very little in common with a FireMonkey control. Where a FireMonkey control look is defined by a (customizable) hierarchy of style elements (such as rectangles, labels, etc...) that are rendered in a Quartz or OpenGL canvas by the FireMonkey framework itself, an iCL control is rendered by the iOS operating system. Where a FireMonkey control's keyboard and mouse (touch) handling is in fact handled by redirected FireMonkey form level keyboard and mouse (touch) handling, the operating system itself handles all this for the iCL control, or better the underlying UIView or similar control. The main result is that an iCL control is not style-able or extensible in the same way as a FireMonkey control and you won't find the typical keyboard or mouse (touch) events as in a FireMonkey control.

iCL and FireMonkey coexist
What is nice is that iCL controls and FireMonkey controls coexist fine on the same FireMonkey form. In fact, we have even created a FireMonkey form wrapper that makes it possible to embed or use these FireMonkey forms with iCL controls (like a tableview detail or popover for example)

Why use iCL controls?
Two very important considerations might make you consider using iCL controls: performance and consistency. While a FireMonkey control always remains an emulation (by means of a style element hierarchy) of an operating system control, the iCL control is the real thing. The iCL control is not just pixel-perfect, whatever the real meaning of pixel-perfect might be, it is just 100% perfect as it is the real control. The same applies to the behavior. Interaction with touch is not just simulated by FireMonkey animations inside in the control, but is the exact Apple defined behavior. Think about the exact scroll bounce effect, the exact glow on touch, the exact slide animation. With this also comes performance. iCL exposes the performance of the operating system control that Apple has maximised and fine-tuned. The best example of this is the tableview that remains extremely fast and responsive, irrespective of the number of items or the complexity of what is displayed in tableview items. A final consideration is that an iCL control is by definition operating system version agnostic. It has by definition always the exact appearance of the operating system control and makes the application that uses them consistent with iOS. An example of this is the switch control where Apple modified the appearance slightly between iOS 5 and iOS 6. The iCL control will always have the right look. As iOS 7 is expected to have a different look again with Jonathan Ive now responsible for the Apple UI design, the iCL will effortless make your app look consistent with iOS 7.

Why use FireMonkey controls?
The standard operating system controls in iOS are quite limited. There is no grid, there is no syntax highlighting memo, there is no chart, ... etc... Much like we have thousands of VCL controls that offer functionality that is not in the operating system, FireMonkey controls exactly offer these extras. The good news is that you can mix both control types to take advantage of each where it fits.

The 'native' confusion
We get quite a number of emails from users asking what the difference is between what is called 'native' FireMonkey mobile applications and iCL native controls. The definition of the exact difference between 'native' and 'native' would take a few pages to explain when applied to the FireMonkey framework in XE4. We'd like to summarize this in a nutshell. iCL exposes the native iOS control where a Delphi FireMonkey application runs as a native, i.e. ARM CPU machine language app on the iOS device. So, a Delphi FireMonkey application using iCL controls is about as native as an Objective C X-Code iOS application.

Limitations
Of course, the first important limitation is that an iCL control is only usable for iOS device applications. So, iCL is like VCL not cross-platform. As we make the iCL controls accessible from the Delphi IDE form designer, running directly on Windows, this means we are forced to show a sort of emulation of the control in the IDE form designer. In the first version, we have chosen to implement only a very rough and basic emulation of the control. As the code to do this being part of the control normally sits in the app and doesn't do anything, we wanted to minimize this bloat. For future versions, we consider to implement the design-time emulation this way that this code won't get linked with the app. Finally, there is currently an RTL limitation that limits the number of different iOS control classes usable in a form.
We have notified Embarcadero about this bug and hope Embarcadero will solve this as soon as possible. The limitation right now is such that for a typical application using some mix of iCL controls won't be affected, but when building something like an iPad form where you intend to use every single iOS control that we offer on the same form, it is likely that you'll bump into this limitation and the application will simply crash when the form opens on the iOS device.

Freedom of choice
After all, it is all about offering Delphi developers freedom of choice to use the technology that fits best their needs and using iCL is just one more such choice. If you struggle with a performance issue, if iOS consistency and 100% UI compliance is a major concern for you, you can now use iCL controls and where some functionality is missing in the standard controls, just add existing, your own or TMS FireMonkey controls. These are exciting times for Delphi developers, so, happy coding!

Bruno Fierens




This blog post has received 4 comments.


1. Friday, June 7, 2013 at 8:12:40 AM

Congratulation Bruno & team, yet again TMS fill the gap left behind by Delphi. I''ve no doubt that if the iCL components are a robust and feature-rich as your VCL components, this will be hugely popular component set.

Sweby Jason


2. Friday, June 7, 2013 at 3:10:26 PM

As usual, you guys are ahead of the curve. Thanks for putting it together.

Gehrsitz Robert


3. Sunday, June 9, 2013 at 5:16:25 PM

Do you have plan to develop native components for Mac and Windows edition of FireMonkey?

Priyo Hutomo


4. Wednesday, June 12, 2013 at 8:19:52 AM

We''re using TMS components a lot for years now - Delphi would be a strange and poor featured framework without them!

iCL seems to be the new big thing from you TMS guys. I''m very eager to be able to test it myself, but I still have to convince my boss to buy XE4 - the TMS fee for iCL is a no brainer ;-)

Thanks again! Keep rocking!

Friedrich Andreas




Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post