How to switch view programmably?

Demo 4 SDK

Review the Demo 4 Project in the SDK for details.

Coding ...

In order to automatically update the table on your iOS device, you need to call

INFOMATO.WCF.DataExchangeService.serviceRequestViewChange(clientIP, viewName, value).

This function lets you control the view on iOS device to switch to another view if desired. If your current view is not shown with a tab bar (a bar at the bottom of a view on iOS device for quick view switching), it will push another view into the navigation stack so that the current view becomes the parent view. For instance, if you set the value to "demo1", the iOS device will switch to demo1 view and showing a back button (top, left corner on iOS device) for you to return to the current view. If your current view is shown with a tab bar (because either its xml file contains a "tabBar" sub node under the "view" node, or a user tapped a tab bar button that led to the current view), it will simply switch to the "demo1" view. Please note that views may be organized by navigation stack or tab bar. When views are organized by a tab bar, the view navigation hierarchy becomes flat. When views are organized by navigation stack, it is easy to trace back the chain of view hierarchy but not easily to switch between views that do not follow a clear hierarchy.

When you feed the value with a special keyword "self" or "refresh," this function will refresh the current view instead. Other special keywords include "home" or "root" for popping out all the views in the iOS navigation controller (navigate by click the back button on the top, left of the iOS device) except the root view (last view), "back" or "pop" for popping out just the current view and display the parent view (that leads to the current view). The special keyword "hom" or "back" has no effects if the current view is shown by a tab bar.

Previous Lesson: How to disable remote control Table of Contents Next Lesson: How to contact us?