iOS API 2.0 Changes
From Xojo Documentation
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.
Names of events, properties and methods updated
Mobile UI classes
iOSCountdownPicker, MobileButton, MobileCanvas, MobileContainer, MobileDateTimePicker, MobileHTMLViewer, MobileImagePicker, MobileImageViewer, MobileLabel, MobileLocation, MobileMapViewer, MobileMessageBox, MobileMotion, MobileMoviePlayer, MobileOval, MobilePopupMessage, MobileProgressBar, MobileProgressWheel, MobileRectangle, MobileScrollableArea, MobileSegment, MobileSegmentedButton, MobileSeparator, MobileSharingPanel, MobileSlider, MobileSwitch, MobileTextArea, MobileTextField, MobileToolbar, MobileToolbarButton, iOSMobileTable, [[iOSMobileTableRowAction], MobileTableCustomCell, MobileTableCellData, iOSMobileTableDataSource, iOSMobileTableDataSourceReordering, iOSMobileTableDataSourceEditing, PointerEvent
- Show(parent As MobileScreen = Nil)
- ShowModal(parent As MobileScreen, style As ModalPresentationStyles = ModalPresentationStyles.Automatic, animate As Boolean = True)
- TabBarVisible As Boolean
- MobileApplication - IconBadgeNumber, AddShortcutItem, HandleShortcutItem, HandleURL
More UI-Related Changes
- MobileUIControl - SetFocus(), ClearFocus()
- iOSSplitView.DisplayMode and DisplayModes enum
- Internet Encoding
- EncodeBase64, DecodeBase64 methods
- Graphics Methods - RestoreState, SaveState, Translate, ClipToPath, ClipToRectangle
- TextInputStream - iOS references
- TextOutputStream - iOS references
- Readable, Writeable interfaces
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 MobileScreens you need to switch to using MobileToolbarButton.
- Most iOS* classes
- Xojo namespaces and their members