ArcGIS Runtime SDK for iOS: AGSPopup Class Reference
ArcGIS Runtime SDK for iOS  100.9
AGSPopup Class Reference

Description

A Popup which displays a geo-element's information.

Instances of this class represent a Popup which associates a geo-element with Popup definition for the purpose of displaying in an AGSPopupsViewController.

Since
100
Inheritance diagram for AGSPopup:
AGSObject

Instance Methods

(id< AGSCancelable >) - evaluateExpressionsWithCompletion:
 
(NSString *) - formattedValueForField:
 
(instancetype) - initWithGeoElement:
 
(instancetype) - initWithGeoElement:popupDefinition:
 
(nullable NSString *) - stringForTemplatedString:
 

Class Methods

(instancetype) + popupWithGeoElement:
 
(instancetype) + popupWithGeoElement:popupDefinition:
 

Properties

id< AGSGeoElementgeoElement
 
AGSPopupDefinitionpopupDefinition
 
AGSSymbolsymbol
 
NSString * title
 

Method Documentation

§ evaluateExpressionsWithCompletion:()

- (id<AGSCancelable>) evaluateExpressionsWithCompletion: (void(^)(NSArray< AGSPopupExpressionEvaluation * > *__nullable results, NSError *__nullable error))  completion

Asynchronously evaluates all expressions, including Arcade FeatureSet functions available at AGSPopupDefinition::expressions. This method must be called before displaying the popup information in a UI so you can use synchronous methods formattedValueForField: and stringForTemplatedString: to get the formatted NSString representation. If there are no AGSPopupDefinition::expressions then result array will be empty. The AGSPopupExpression may be used in the AGSPopupDefinition::fields, AGSPopupDefinition.media, AGSPopupDefinition.title and AGSPopupDefinition.description.

Parameters
completionBlock that is invoked when the operation finishes. The results parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.8

§ formattedValueForField:()

- (NSString*) formattedValueForField: (AGSPopupField *)  popupField

Returns a string you can use in a display for the Popup's field value. String will have the proper formatting based on the field type and AGSPopupField configuration. Dates and times are returned in the local timezone. If AGSPopupDefinition::expressions is not empty then the AGSPopupField may be using expressions with Arcade FeatureSet functions. Use evaluateExpressionsWithCompletion: to evaluate the Arcade expressions before trying to get the formatted NSString representation of the popup field's value, otherwise it may return an empty string.

Parameters
popupFieldThe field for which a properly formatted value is desired
Returns
user-friendly string representing the value
Since
100

§ initWithGeoElement:()

- (instancetype) initWithGeoElement: (id< AGSGeoElement >)  geoElement

Initialize the Popup for the provided geo-element. A default Popup definition will be created based on the geo-element's attributes or schema specifying how the geo-element should be represented in the Popup.

Parameters
geoElementfor which to create a Popup
Returns
A new Popup
Since
100

§ initWithGeoElement:popupDefinition:()

- (instancetype) initWithGeoElement: (id< AGSGeoElement >)  geoElement
popupDefinition: (nullable AGSPopupDefinition *)  popupDefinition 

Initialize the Popup for the provided geo-element based on the Popup definition.

Parameters
geoElementfor which to create a Popup
popupDefinitionspecifying how the geo-element should be represented in the Popup If you pass nil for the popupDefinition a default one will be created for you based on the geo-element's attributes or schema.
Returns
A new Popup
Since
100

§ popupWithGeoElement:()

+ (instancetype) popupWithGeoElement: (id< AGSGeoElement >)  geoElement

Initialize the Popup for the provided geo-element. A default Popup definition will be created based on the geo-element's attributes or schema specifying how the geo-element should be represented in the Popup.

Parameters
geoElementfor which to create a Popup
Returns
A new Popup
Since
100

§ popupWithGeoElement:popupDefinition:()

+ (instancetype) popupWithGeoElement: (id< AGSGeoElement >)  geoElement
popupDefinition: (nullable AGSPopupDefinition *)  popupDefinition 

Initialize the Popup for the provided geo-element based on the Popup definition.

Parameters
geoElementfor which to create a Popup
popupDefinitionspecifying how the geo-element should be represented in the Popup If you pass nil for the popupDefinition a default one will be created for you based on the geo-element's attributes or schema.
Returns
A new Popup
Since
100

§ stringForTemplatedString:()

- (nullable NSString*) stringForTemplatedString: (NSString *)  templatedString

Substitutes attribute templates in a string with actual values. If AGSPopupDefinition::expressions is not empty then the AGSPopupField may be using expressions with Arcade FeatureSet functions. Use evaluateExpressionsWithCompletion: to evaluate the Arcade expressions before trying to get the NSString for templated string, otherwise it may return an empty string.

Parameters
templatedStringThe templated string.
Returns
user-friendly string
Since
100

Property Documentation

§ geoElement

- (id<AGSGeoElement>) geoElement
readnonatomicstrong

The geoElement which this Popup is associated with.

Since
100

§ popupDefinition

- (AGSPopupDefinition*) popupDefinition
readnonatomicstrong

A Popup definition that dictates which information belonging to the geo-element should be displayed in the Popup and how it should be formatted.

Since
100

§ symbol

- (AGSSymbol*) symbol
readnonatomicstrong

The Popup symbol.

Since
100

§ title

- (NSString*) title
readnonatomiccopy

The text to display as the Popup title.

Since
100