# Convert to IOS

**URL:** <https://forum.xojo.com/t/convert-to-ios/61027>\
**Category:** iOS\
**Created:** [February 7, 2021, 4:01pm UTC](https://forum.xojo.com/t/convert-to-ios/61027 "2021-02-07T16:01:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [February 7, 2021, 4:01pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/1 "2021-02-07T16:01:34Z")

</div>

I have built an App for Apple MAC. Given Xojo is ‘multi-platform’ development, I thought it would be easy to convert this App to an IOS version. Is it? Has anyone done this, what problems are there, does it take much time, OR do I start again?

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 7, 2021, 6:35pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/2 "2021-02-07T18:35:38Z")

</div>

> [@Bill\_Snaith](#):
>
> Has anyone done this, what problems are there, does it take much time, OR do I start again?

I’ve tried a few times.  
(yes, that means I haven’t succeeded yet, but my needs are specialised)

It’s by no means a ‘one click’ job  
Controls are different.  
Xojo syntax is different.

if you have kept your business logic away from your UI you will make better progress

A lot depends on what your app does.  
Pure business apps with text boxes , database , and radio buttons will be relatively OK  
Listboxes need a whole new paradigm as they are on-demand rather than populated and left to get on with it.

And the cost of an iOS licence is very high compared to the other Xojo single-target licences, so unless you have a pro licence, there is an investment there to consider.

---

<div class="post-metadata">

**Author:** ![Art\_Gorski](https://forum.xojo.com/user_avatar/forum.xojo.com/art_gorski/32/704_2.png) [@Art\_Gorski](https://forum.xojo.com/u/Art_Gorski)\
**Post date:** [February 7, 2021, 7:29pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/3 "2021-02-07T19:29:58Z")

</div>

> [@Jeff\_Tullin](#):
>
> if you have kept your business logic away from your UI you will make better progress

With the recent changes to iOS, more code will be common. In the past you had to use Text on iOS while MacOS used String, for example. That at least is no longer the case.

The main difficulty will be the huge difference in UI between MacOS and iOS. You’ll have to rethink lots of stuff.

I only develop for iOS and renew my license when it goes on sale. Interestingly, all my iOS apps “just work” on my M1 Mac mini. So there may be a trend of development switching from MacOS to iOS in the future.

---

<div class="post-metadata">

**Author:** ![Chris\_Halford](https://forum.xojo.com/user_avatar/forum.xojo.com/chris_halford/32/480_2.png) [@Chris\_Halford](https://forum.xojo.com/u/Chris_Halford)\
**Post date:** [February 9, 2021, 10:29am UTC](https://forum.xojo.com/t/convert-to-ios/61027/4 "2021-02-09T10:29:51Z")

</div>

I say give it a go. There could be some paradigm shifts to consider, but once you see the patterns, converting isn’t bad anymore.

This last week I converted a massive program to iOS.  
I had to recreate the user interface (obviously) and I had to change all the instances of format to toString, but aside from that it went quite well.  
Over the last year or two I’ve tried a few times with zero success, but with the current build it’s become a lot easier.

My current application had a lot of heavy math that worked in realtime with paint events from canvases. These converted over with only a few tweaks from things like g.fontAscent to g.font.ascent (not difficult).  
There are a few gotchas with setting font attributes and names, but nothing too bad.

If you use the Einhugur or MBS plugins then you would have been blocked from migrating your code, but those limitations are in the past. There is a current issue with Xojo and MBS not compiling in an App Store friendly way, but I think that’s going to be resolved quickly. In the meantime you can certainly test and develop without issue.

Screen shot attached to give you a sense of it from desktop to iOS.  
I’m considering moving to web too, but I think that will be more challenging.

 ![image](https://forum.xojo.com/uploads/default/original/2X/f/fc851d7e86542fd421154fc0598b3a1656bbd993.jpeg)

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [February 9, 2021, 11:34am UTC](https://forum.xojo.com/t/convert-to-ios/61027/5 "2021-02-09T11:34:13Z")

</div>

Thank you Jeff, appreciate your knowledge and experience on this.

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [February 9, 2021, 11:35am UTC](https://forum.xojo.com/t/convert-to-ios/61027/6 "2021-02-09T11:35:32Z")

</div>

Art, this is helpful, I like the caution on UI and business.

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [February 9, 2021, 11:37am UTC](https://forum.xojo.com/t/convert-to-ios/61027/7 "2021-02-09T11:37:17Z")

</div>

Hi Chris. Thank you very much for this. It is instructive, helpful and detailed enough for me to know what to review in my App, before investing in IOS from Xojo. Great thanks.

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [March 28, 2021, 12:47am UTC](https://forum.xojo.com/t/convert-to-ios/61027/8 "2021-03-28T00:47:27Z")

</div>

Jeff, thank you for your response, it is very helpful, and apologies for delay in replying.  
How can the code I have be transferred across to an IOS project? I can’t see how to do this?  
As an aside, I wonder since XOJO is “cross platform development”, why can the code not be more easily transferred [I do understand different architecture and OS etc].

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [March 28, 2021, 5:59am UTC](https://forum.xojo.com/t/convert-to-ios/61027/9 "2021-03-28T05:59:27Z")

</div>

> [@Bill\_Snaith](#):
>
> As an aside, I wonder since XOJO is “cross platform development”, why can the code not be more easily transferred [I do understand different architecture and OS etc].

The iOS code we have had for many years previous was very incompatible, (although some excellent work had been done by Michel and others to wrap ‘new code’ in a form that could be called by ‘normal code’)  
I could be mistaken, but it felt to me that either Xojo had decided it needed a new framework and wanted to use iOS as a lever to bring everything else in line, or that the person developing it wouldn’t write it unless it was done ‘their way’

Anyway, the newer API2 and recent work on iOS to allow Strings , has made the code much closer.

If you write code in a module for iOS, it’s relatively easy to copy and paste into a desktop project and vice versa.  
Ive been doing that recently myself.

The stumbling blocks are only really at the point where you consider the UI.  
Anything that talks to a control, and some things that relate to events, need to be recoded.  
Which is why I recommended splitting the business and GUI code.

A routine that calculates the amount of fuel required to turn a transport ship around in the Suzez canal can exist in a module, and doesnt need to know anything about text boxes or canvases.  
It has input and output parameters, and will work fine in desktop or mobile.

> How can the code I have be transferred across to an IOS project?

Literally -‘copy and paste’

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [March 28, 2021, 6:55am UTC](https://forum.xojo.com/t/convert-to-ios/61027/10 "2021-03-28T06:55:24Z")

</div>

Great response Jeff, thanks. I have a large App. And copy & paste would be an enormous task, enormous! I had hoped [maybe wrongly] that I could open the App in Xojo, change the tick boxes for the ‘compile for’ from MacOS to IOS, and then start conversion … but clearly it’s NOT that easy at all.  
There is traffic on the forum saying IOS apps, run on the new Apple M1 architecture without recompile, might it possible vice versa I wonder?

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [March 28, 2021, 7:01am UTC](https://forum.xojo.com/t/convert-to-ios/61027/11 "2021-03-28T07:01:39Z")

</div>

That is interesting, IOS ‘just works’ on MAC. I wonder therefore if it can work the other way soon? Clearly screen size, files etc can be different, but the hope comes from ‘Sidecar’, I can run my App on the MACBook and sidecar to my iPad and it looks superb, fits perfectly and operates brilliantly …except, when opening some. Other windows, they show up on my MacBook screen[?].

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [March 28, 2021, 7:51am UTC](https://forum.xojo.com/t/convert-to-ios/61027/12 "2021-03-28T07:51:11Z")

</div>

> [@Bill\_Snaith](#):
>
> the hope comes from ‘Sidecar’

No.  
Sidecar is more like RDP - it’s a screen viewer and controller.  
You aren’t running the software on the iPad’s processor, you are manipulating the screen and the input devices.

iOS apps will run on M1 chip Macs because the processor is the same. (doesnt work on intel machines)

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [March 28, 2021, 8:00am UTC](https://forum.xojo.com/t/convert-to-ios/61027/13 "2021-03-28T08:00:03Z")

</div>

Yes, thanks, and I know sidecar is like RDP. I simply meant my app screen fits perfectly on the iPad so I know IF I COULD convert it would look great.  
The point of “same chip” is why won’t that work both ways? Just a dream!

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [March 28, 2021, 8:19am UTC](https://forum.xojo.com/t/convert-to-ios/61027/14 "2021-03-28T08:19:05Z")

</div>

My _personal_ frustrations for iPad are  
Its INCREDIBLY hard to get data into an iPad app from elsewhere, using Xojo.  
(Shared files is widely despised and not understood by users, and Xojo iOS apps cannot open files in iCloud. URLHandler seems impossible to implement too)  
the small screen,  
the use of a finger as a pointing device (like drawing with a carrot!),  
the lack of right-click,  
and the lack (for obvious reasons) of being able to hover a mouse over something

Feels like everything needs to be bigger and operable using ‘monkey point’ gesturing.  
(Which of course is what Apple appears to be turning MacOS into.)

> I simply meant my app screen fits perfectly on the iPad so I know IF I COULD convert it would look great.

Nothing stopping you if its a business app and texty  
You could probably reconstruct the display using canvas controls and handling them yourself at a push.  
iOS buttons just dont LOOK like buttons  
You dont get menus.  
And so on.  
I have sucessfully co-erced a segmentedbutton control into a workable toolbar replacement.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [March 28, 2021, 8:35am UTC](https://forum.xojo.com/t/convert-to-ios/61027/15 "2021-03-28T08:35:07Z")

</div>

Apparently, and with Xojo 2019r1.1, you can add a module to an iOS project.  
You also can export the module,  
You can also import the module.

Please, confirm if this works for you (migrating code from Desktop to iOS project).

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [March 28, 2021, 8:52am UTC](https://forum.xojo.com/t/convert-to-ios/61027/16 "2021-03-28T08:52:17Z")

</div>

> [@Emile\_Schwarz](#):
>
> also import the module.

Should work fine

---

<div class="post-metadata">

**Author:** ![Bob\_Gordon](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/898d66/32.png) [@Bob\_Gordon](https://forum.xojo.com/u/Bob_Gordon)\
**Post date:** [April 8, 2021, 5:07pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/17 "2021-04-08T17:07:58Z")

</div>

Bill,

With the new Mobile framework, it should be easier than it was before.  
One thing I did is subclassed all the controls. So on Web a TextField is an RDDTextField; on Desk, an RDDTextField; on Mobile, an RDDTextField. (The superclass on each was different, of course). Having done that, I’ve literally been able to copy controls (at least Web to Desk and back, haven’t tried it with new Mobile framework yet) from one platform and paste them in another.

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [April 9, 2021, 3:15pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/18 "2021-04-09T15:15:49Z")

</div>

Bob,  
Thank you for this detailed response, it sounds a very good approach and simplifies transition.  
As a learner, can you give me one example of “subclassed all the controls” please, that would be a great help. I am close to setting up my Xojo built MAC desktop App. for the Apple App.store and no doubt will have some questions for the forum about this too, and with a view to transiting my App to the iPad in future. Thank you again.

---

<div class="post-metadata">

**Author:** ![Bob\_Gordon](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/898d66/32.png) [@Bob\_Gordon](https://forum.xojo.com/u/Bob_Gordon)\
**Post date:** [April 9, 2021, 9:39pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/19 "2021-04-09T21:39:11Z")

</div>

Bill,

Here’s what I suggest… Try a very simple app. Desk with one window and one text field. iOS with one Screen and one text field. Except don’t use the built-in textfields directly. On each platform subclass the textfield as a new class (you might name it “mytextfield”). You may be able to copy it from one platform to another.

Also, we may want to take this discussion out of the forum for awhile. We can do email or phone or both.

-Bob

---

<div class="post-metadata">

**Author:** ![Bill\_Snaith](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Bill\_Snaith](https://forum.xojo.com/u/Bill_Snaith)\
**Post date:** [April 11, 2021, 9:57pm UTC](https://forum.xojo.com/t/convert-to-ios/61027/20 "2021-04-11T21:57:37Z")

</div>

Bob,

> **Summary**
>
> can you give me your email to use please. I have hidden this text .

[Next page](https://forum.xojo.com/t/convert-to-ios/61027.md?page=2)
