Skip to content

SmartModel

Cristina Suciu edited this page Dec 23, 2020 · 2 revisions

The Smart Model is a separate model encapsulating the display business logic for a Smart List. The Model class contains the business logic for what to display in a given list while the Smart List is a meta-level model that can adjust the presentation items in a model.

The base class for SmartModels is DUXBetaSmartListModel and can be subclassed for other Smart Models.

And example of this is the System Status List Widget. That widget displays relevant system status line items appropriate for the connected aircraft. Not all items are appropriate for all aircraft. So the Smart Model used in the System Status List Widget observes what is connected, and then builds a list of widgets for presentation by the System Status List Widget. The System Status List Widget Model is then tasked with managing the specific list of widgets for the currently connected aircraft.

To create a custom Smart Model, override the method

Swift

func buildModelLists()

Objective-C

- (void)buildModelLists;

Internally this method fills in the instance array called modelClassnameList with the class names of the widgets to be created for Smart List.

Clone this wiki locally