> ## Content Index
> Fetch the complete content index at: https://blogs.remobjects.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Custom iOS Controls in Oxygene "Nougat"
- URL: https://blogs.remobjects.com/2013/02/22/custom-ios-controls-in-oxygene-nougat/
- Published: 2013-02-22T18:45:50.000Z
- Updated: 2018-08-22T06:17:41.000Z
- Author: marc hoffman
- Tags: #Import 2026-08-17 20:17

A week or so back, Yari D’areglia had an excellent tutorial on his blog on [How to build a custom control in iOS](http://www.thinkandbuild.it/how-to-build-a-custom-control-in-ios?ref=blogs.remobjects.com) that gave a nice rundown of some of the tasks involved, including handling touches, drawing some non-trivial custom UI, and returning events to the application via the target/action pattern.

While Oxygene “Nougat” can of course use any such controls directly and without having to convert or wrap them, i thought it would be fun to try and port the code over to Nougat and see what it looks like (and what kind, if any, challenges would be involved).

We don’t have [Oxidizer](wiki.oxygenelanguage.com/en/Oxidizer) support for Objective-C *yet*, so i did this manually, but it was still a very straight-forward process, and below are a few notes:

- It turns out the new “Auto-Fix” for `=` vs. `:=` assignments that [we are shipping](http://www.remobjects.com/oxygene/whatsnew?ref=blogs.remobjects.com) in the February release (which RTMs today) is a **huge** time saver. Just leave all the “`=`” in place, and the compiler will fix them for you when you hit build. This is new since i last converted code a few weeks back, and a much appreciated improvement.
- There’s really only two “repetitive” tasks i found myself doing a lot to convert Obj-C to pascal: (a) changing Objective-C style “`[]`” method calls to use regular Oxygene “`.`” or “`:`” operators and (b) replacing type names with “var” in local variable declarations, such as `CGpoint centerPoint = …` to simply `var centerPoint…`.
- There were a couple of C macros used in the original code, which translated nicely into inline methods — a new feature in the Oxygene language for version 6.0.

All in all, i spent maybe 30 minutes last night converting and then tweaking/cleaning the code, and then the control and surrounding sample app was working perfectly (i also found a couple of new compiler bugs — remember Nougat *is* still beta — which always makes Carlo happy. When i woke up this morning, they were already fixed ;).

If you’re at all interested in creating your own controls for iOS (whether in Nougat or in Objective-C), i recommend to check out [Yari D’areglia’s post](http://www.thinkandbuild.it/how-to-build-a-custom-control-in-ios?ref=blogs.remobjects.com). His original code can be found on [GitHub](https://github.com/ariok/TB%5FCircularSlider?ref=blogs.remobjects.com), as can be [my ported version](https://github.com/dwarfland/TBCircularSlider-Oxygene?ref=blogs.remobjects.com).

!\[Screenshot\](https://raw.github.com/dwarfland/TBCircularSlider-Oxygene/master/README.png)