iOS API 2.0 changes

2020 Release 2 adds API 2.0 support to iOS projects, plus a whole lot more.

On a high level, the String and Variant data types are now available for use to replace the now deprecated Text and Auto data types. There are many new controls and classes that have been added, which you can see in the list below.

API 2.0

Names of events, properties and methods updated

Data types

String, Variant, DateTime, Pair, Dictionary (see notes on this page)

MobileScreen

MobileApplication

  • MobileApplication - IconBadgeNumber, AddShortcutItem, HandleShortcutItem, HandleURL

Framework

Graphics

Files

Encodings

Miscellaneous

Notes

Your old projects should work with little or no changes. It is possible you will have to update some older code to be compatible with the above changes.

  • If Use Simple References was turned on for your iOS project, you may get compiler errors as the compiler might confuse things from the Xojo namespaces with classes that are now available with the same name (such as Dictionary). Adding the fully qualified name when there is confusion (such as Xojo.Core.Dictionary) will resolve the compile error.

  • You might also consider turning off Use Simple References and then manually add the necessary Using clauses to your project items as necessary.

  • If you have your own extension methods that replicate functions now built into the framework, you'll need to remove them to avoid confusing the compiler.

To migrate existing projects to API 2.0, you will need to manually change the following:

  • The Super on your App object from iOSApplication to MobileApplication.

  • The Supers on iPhoneScreen and iPadScreen from iOSScreen to iOSLayout.

  • The Supers of your Views from iOSView to MobileScreen.

  • The Supers of controls on these MobileScreens from their iOS versions to their Mobile counterparts.

  • Switch use of any Xojo namespace classes to their corresponding API 2.0 classes.

You can mix and match iOS controls and Mobile controls on the same views and screens, so you should not have to update everything all at once. In many cases you can continue using the older control and only switch to the newer control when you are ready.

  • iOSToolButtons can only be on iOSViews. To put toolbar buttons on MobileScreen.

Deprecations

  • Most iOS* classes

  • Xojo namespaces and their members