Show TOC

OpenUI Overview for iOSLocate this document in the navigation structure

OpenUI enables application designers to customize applications by defining the views to be displayed for each field in an Agentry screen programmatically using the platform's natural language. For iOS, that language is Objective-C.

The OpenUI framework in iOS allows an arbitrary Objective-C class to become an extension to an Agentry Screen Field. The class needs to implement the proper SMPOpenUIFieldAdapter protocol. By doing this, Agentry is able to:
  • Notify the class when the data it is displaying has been modified, or some of its display attributes have changed,

  • Request desired behavior from the class such as whether a label should be displayed for the field by Agentry, and

  • Request from the class the view to display in the Agentry Screen.

To enable this behavior, the application designer needs to provide the name of the adapter class for the field in the Agentry Editor. This is done via the Field Extension tab in the editor for each field type that supports OpenUI extensions. For a more detailed description of how to accomplish this, see OpenUI Getting Started (iOS).

All field extension adapters are provided at initialization time with an object implementing the proper SMPOpenUIFieldModel protocol. By using this object, the adapter object is able to query Agentry for the data the adapter is required to represent and other attributes.

For each specific field type that supports OpenUI, the user is able to enter the adapter extension class name in the Agentry Editor in the Extension tab of the field definition. This causes the framework to try to instantiate an adapter with that class name at runtime, and display its view in the corresponding screen where the field was defined.

Adapter Protocols

All adapter protocols are listed in this landing page. When a screen is being constructed by the Agentry Client, the client checks to see if a field has been extended. If so, it checks to see if the provided extension class implements the correct adapter protocol for the field type. If so, it instantiates the adapter class, and provides it with a model. After this, a UIView is requested from the adapter to be displayed by Agentry in the detail screen.

Model Protocols

Objects implementing the correct model protocol will be provided to adapters at construction in order to serve as access to the data in Agentry, as well as provide methods to modify such data when the user has done so.

The following class diagram is a graphical representation of how models and adapters work together with Agentry:

For the interface documentation of all the available OpenUI Objective-C protocols, see the iOSOpenUIExternal module in source code.