The development of an iOS Widget application and its associated iOS application is similar to the development of a standard application.
For the iOS application
, you create the different elements of your application. The method for developing the project is identical to the method for developing a WINDEV Mobile project. However, some specific features of the development for iOS must be complied with. See Specific features of iOS applications
for more details.
For the iOS Widget application, you can:
- create windows. These are iOS Widget windows (see limitations below).
- add controls into the windows. The following controls are available in an iOS Widget application:
- Check Box and Swtich,
- Radio Button,
- Progress Bar, Infinite Progress Bar,
- List Box,
- Bar Code,
- Control template, Supercontrol, group of controls,
- Internal window.
- use WLanguage functions, properties and types. The icon indicates whether the feature is available in iOS Widget.
In iOS Widget Mode, using the keyboard or scrolling is not allowed.
Caution: iOS limits the memory available for widgets. This limitation depends on the device, iOS version, other applications, ... It is recommended to limit memory usage in your iOS Widget configurations as much as possible:
- 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 following error: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=xxx MB, unused=xxx)
When the development is completed, you can generate the Xcode project to compile the iOS Widget application and its associated iOS application on MAC:
- Click among the quick access buttons.
- Choose (if necessary) the first window displayed on the different platforms (iPhone, iPad and iOS Widget).
- The generation wizard starts. See Generating the application for more details on Xcode project generation.
Remark: A specific step ("Apple Widget (iOS Widget)") is displayed in the wizard. This step allows you to set the name of the Widget and its signature. The widget "Bundle ID" corresponds to that of the iOS application plus ".<Name of iOS Widget configuration>" at the end. It is necessary to register the 2 "Bundle IDs" (application and widget IDs) in the "Provisioning profile".
Windows of iOS Widget applications
In the iOS Widget platform, windows created in the editor have a specific size for iOS Widgets.
Indeed, the window width and height are set by the iOS system and depend on the device on which the widget is executed.
- The window proposed in the window editor corresponds to the minimum possible width. To manage the size of your Widget at runtime, you must use anchors.
- The window proposed in the window editor corresponds to the minimum possible height for a collapsed Widget. It is possible to display the Widget in expanded mode. Simply define the desired maximum size with ..HeightExpanded. When the expanded height is greater than the collapsed height, the iOS Widget can be expanded. The expanded height will be defined by the system. It can be between the collapsed height and the desired expanded height. It is also recommended to use anchors to manage the expanded mode.