ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing for iOS (iPhone / iPad)
  • Overview
  • Creating a project for iOS 14 widget with WINDEV Mobile
  • Developing an application for iOS widget with WINDEV Mobile
  • Overview
  • iOS application
  • iOS 14 widget
  • Testing the iOS 14 widget application
  • Generating Xcode project
  • WLanguage functions specific to iOS 14 widgets
  • Functions for managing widgets
  • Functions available for widgets
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
An iOS widget is an application intended to be displayed as a widget on iOS devices (iPhone, iPad, etc.).
An iOS widget is always associated with an iOS application.
An iOS widget is developed in several steps:
This help page only presents the creation of an iOS widget project and its development. It is generated and compiled in the same way as a standard iOS application.
Creating a project for iOS 14 widget with WINDEV Mobile
To create an iOS 14 widget project with WINDEV Mobile:
  1. Create a project for iOS (for more details, see Developing an application for iPhone/iPad).
  2. Create an iOS 14 widget configuration:
    • Launch the wizard to create a new configuration: under the "Project" pane, in the "Project configuration" group, pull down "New configuration" and select the "New configuration (via wizard)" option..
      For more details, see Project configuration.
    • In the "General information" step of the wizard, select "iOS widget".
    • In the "Associated iOS application" step of the wizard, select the iOS configuration of the project associated with the iOS widget configuration.
Developing an application for iOS widget with WINDEV Mobile

Overview

The development of an iOS 14 widget and its associated iOS application is similar to the development of a standard application.

iOS application

Create the different elements of your iOS application. The method for developing the project is identical to the method for developing a WINDEV Mobile project. However, there are some aspects specific to iOS development. For more details, see Specific features of iOS applications.
Note: It is possible to communicate between the widget and the iOS application:
  • via a back-end solution (web service, HFSQL)
  • via a shared App Group container (iOSAppGroupDirectory).

iOS 14 widget

To develop the iOS 14 widget, you will need to:
  • create Widget windows. These windows contain all the features required by your widget.
    Remarks:
    • To create widget windows, you must have enabled the "widget" configuration.
    • Only two types of fields are available in iOS 14 Widget windows: Image fields and Static Text control fields..
    • iOS 14 widget windows have a number of specific features. For more details, see iOS widget windows.
  • use WLanguage functions, properties and types. If a function is not available, a compilation error is displayed. The icon appears in the help page if the function is available for iOS 14 widgets.
  • define the procedure to be executed when the user clicks the widget, using WidgetProcedure. This function must be used in the project initialization code.
In iOS 14 widget mode, scroll gestures and keyboard input are not supported.
Attention: iOS limits memory available for widgets. The value of this limitation depends on hardware, iOS version, other applications, ... We advise you to limit memory consumption as much as possible in your iOS 14 Widget configurations:
  • Limit the number of controls.
  • Prefer internal windows to plans,
  • Check the size of images (especially for the style of controls).
If the widget exceeds the limit, it will be killed by iOS with the error: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=xxx MB, unused=xxx)

Testing the iOS 14 widget application

You can directly test iOS 14 widget windows in the WINDEV Mobile simulator. The characteristics of Widget windows are taken into account.
Remarks:
  • WMDev tests are not available.
  • When testing from Xcode, a widget mode is forced by default. If necessary, you change the configuration in Xcode (refer to the Xcode documentation).

Generating Xcode project

When the development is completed, you can generate the Xcode project to compile the iOS widget application and its associated iOS application on MAC:
  1. Click in the quick access buttons.
  2. Choose (if necessary) the first window displayed on the different platforms (iPhone, iPad and iOS widget).
  3. The generation wizard starts. For more details on Xcode project generation, see Generating the application.
Note: A specific "Signature Widget (iOS Widget)" step is displayed in the wizard.. This step allows you to sign the iOS widget. The bundle ID of the widget is the bundle ID of the iOS app, plus ".widget" at the end. Both bundle IDs should be added to the Provisioning Profile.
WLanguage functions specific to iOS 14 widgets

Functions for managing widgets

The following functions are used to manage specific features of iOS 14 widgets:
InWidgetModeIndicates whether the code is run in Android widget mode.
WidgetDisplayRefreshes a widget window.
WidgetProcedureSpecifies the procedure that will be called when the user clicks an iOS 14 widget.

Functions available for widgets

Most of the functions available for iOS applications are also available in iOS 14 widget mode. To easily identify these functions, the icon appears in the bar of function platforms.
Minimum version required
  • Version 26
Comments
Click [Add] to post a comment

Last update: 09/30/2024

Send a report | Local help