Skip to content

iOS Improvements in Xojo 2018 Release 2

Xojo 2018 Release 2 brings several improvements to iOS features such as iOSTable, iOSView and more.

iOSTable Pull-to-Refresh

You can now enable pull-to-refresh on iOSTables by setting the AllowRefresh property to True. This allows the user to drag down from the top of the table to initiate a refresh which displays the spinner UI at the top. When they do this, the Refreshed event is called where you can reload data as necessary. When you have finished refreshing the data, call the EndRefresh method to remove the spinner UI.

iOSTable Custom Row Heights

When using iOSCustomTableCells within an iOSTable you may have times when the cell heights vary. To allow the table to display rows with cells of varying height, set the UseDynamicHeight property on the custom table cell to True.

Then when you add the custom cell to the table, change its bottom constraint to be constrained how you want. For example, this code changes the bottom constraint to be the bottom of a label that can have different amounts of text that change its height. This code does just that in the RowData method of the class that implements iOSTableDataSource:

// Set container bottom constraint to the bottom of a label that
// can change its height.
Dim bottomConstraint As New iOSLayoutConstraint( _
  customCell, _ // firstItem
  iOSLayoutConstraint.AttributeTypes.Bottom, _ // firstAttribute
  iOSLayoutConstraint.RelationTypes.Equal, _ // relation
  customCell.TeamNameLabel, _ // secondItem
  iOSLayoutConstraint.AttributeTypes.Bottom, _ // secondAttribute
  1.0, _ // multiplier
  iOSLayoutConstraint.StandardGap, _ // gap
  1000) // highest priority

customCell.AddConstraint(bottomConstraint)

Download sample project.

You can also use this property when you are using multiple custom cells in your table to allow the table row height to increase automatically to fit the cell size.

iOSView Large Titles

iOSView has a new property called LargeTitleMode which can be used with iOS 11 or later. LargeTitleMode accepts three values: Always, Automatic, Never. For backwards compatibility it defaults to Never. To use this feature on iOS 11+, set it to Automatic or Always. As you would expect, Always makes the title always use the large size. With Automatic, the title of the view is only set to Large if the previously displayed view was also set to Large.

Other Improvements

  • iOSHTMLViewer now uses WKWebView for better compatibility.
  • iOSSQLiteDatabase has been updated to SQLite 3.23.1.
  • iOSApplication.Open now receives the launchOptions Ptr as a parameter (for use with Declares) and returns a boolean as to whether or not the app is handling the request.
  • Inserting or Removing a row/section within the visible rows of an iOSTable is now animated.

Download Xojo 2018 Release 2 to try out these iOS improvements.