ArcGIS Runtime SDK for iOS
100.15
|
A popup manager.
Instances of this class represent a popup manager that contains the necessary business logic for displaying and editing popup information for geoelements. This class is useful, for instance, if you want to create your own View Controller for displaying AGSPopup
instead of using AGSPopupsViewController
.
Properties | |
AGSPopupAttachmentManager * | attachmentManager |
NSDictionary< NSString *, NSError * > * | contingencyValidationErrors |
NSDictionary< NSString *, NSError * > * | contingencyValidationWarnings |
AGSSketchEditor * | currentSketchEditor |
NSString * | customDescriptionHTML |
id< AGSPopupManagerDelegate > | delegate |
NSArray< AGSPopupField * > * | displayFields |
NSArray< AGSPopupField * > * | editableDisplayFields |
BOOL | editing |
NSString * | editSummary |
NSArray< AGSPopupElement * > * | evaluatedElements |
AGSFeatureType * | featureType |
BOOL | geoElementValid |
AGSPopup * | popup |
BOOL | shouldAllowDelete |
BOOL | shouldAllowEdit |
BOOL | shouldAllowEditAttachments |
BOOL | shouldAllowEditGeometry |
BOOL | shouldShowAttachments |
BOOL | shouldShowCustomDescriptionHTML |
BOOL | shouldShowEditSummary |
BOOL | shouldShowMedia |
AGSSymbol * | symbol |
NSString * | title |
- (void) cancelEditing |
Cancels the editing of the popup. This reverts the geoelement back to its original state.
- (nullable AGSContingentValuesResult *) contingentValuesResultForField: | (AGSPopupField *) | popupField |
Returns contingent values for each AGSFieldGroup
that the specified AGSPopupField
belongs to. If the specified AGSPopupField
belongs to more than one field group, this method returns all groups with the values that are common in all the field groups, in AGSContingentValuesResult
.
popupField | The ASGPopupField to get the contingent values for. |
- (nullable AGSDomain*) domainForField: | (AGSPopupField *) | popupField |
Returns the AGSDomain associated with a given AGSPopupField
- (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 and after finishEditingWithCompletion:
so you can use synchronous methods formattedValueForField:
and stringForTemplatedString:
and property AGSPopupManager::customDescriptionHTML
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
.
completion | Block that is invoked when the operation finishes. The results parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (BOOL) featureTypeChangeRequiresUserNoficationForTemplate: | (nullable AGSFeatureTemplate *) | featureTemplate |
Method you can call to determine if you need to notify the user when a AGSFeatureType is going to change.
featureTemplate | The template that the user wants to change to. |
#featureTypeChangeRequiresUserNotificationForTemplate
instead - (BOOL) featureTypeChangeRequiresUserNotificationForTemplate: | (nullable AGSFeatureTemplate *) | featureTemplate |
Method you can call to determine if you need to notify the user when a AGSFeatureType is going to change.
featureTemplate | The template that the user wants to change to. |
- (nullable AGSPopupField*) fieldForName: | (NSString *) | fieldName |
Returns the AGSPopupField for a given field name.
- (BOOL) fieldIsNullable: | (AGSPopupField *) | popupField |
Returns whether or not a given AGSPopupField allows null values.
- (BOOL) fieldIsTypeIDField: | (AGSPopupField *) | popupField |
Returns whether or not a given AGSPopupField is the TypeID field.
- (AGSFieldType) fieldTypeForField: | (AGSPopupField *) | popupField |
Returns the field type for a given AGSPopupField.
- (void) finishEditingWithCompletion: | (void(^)(NSError *__nullable error)) | completion |
Finish editing the popup. Async method that calls back when complete. This method commits any attachment and attribute changes to the AGSGeoElement.
- (NSString*) formattedValueForField: | (AGSPopupField *) | popupField |
Returns a string you can use in a display for the current popup field's 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: (AGSPopup)
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.
- (instancetype) initWithPopup: | (AGSPopup *) | popup |
Initializes an AGSPopupManager with an AGSPopup. This initializer will retain the passed in popup strongly. If the AGSGeoElement associated with the popup conforms to AGSLoadable it must be loaded for the AGSPopupManager to work properly.
- (BOOL) isFieldInFieldGroup: | (AGSPopupField *) | popupField |
Returns a Boolean value indicating whether the given AGSPopupField
is part of a AGSFieldGroup
, as defined in a AGSContingentValuesDefinition
.
- (NSString *) labelForField: | (AGSPopupField *) | popupField |
Returns a user-friendly display name for the provided popup field
- (NSInteger) lengthForField: | (AGSPopupField *) | popupField |
Returns the field length given an AGSPopupField.
- (nullable NSNumber*) numberFromString: | (NSString *) | stringValue | |
field: | (AGSPopupField *) | popupField | |
Creates correct number type from a string. Uses the AGSPopupField to determine type of number to return (int, double, etc)
numberFromString:field:error:
instead. - (nullable NSNumber*) numberFromString: | (NSString *) | stringValue | |
field: | (AGSPopupField *) | popupField | |
error: | (NSError **) | error | |
Creates correct number type from a string. Uses the AGSPopupField to determine type of number to return (int, double, etc). If the string contains invalid characters it will return nil and fill out the appropriate error. If the string is parsed correctly but the number is out of range for the field's range domain (if there is one) then it will return nil. If the string is parsed correctly but the number is out of numeric range for the appropriate field type then it will return nil and fill out the appropriate error.
- (nullable NSString*) rangeValidationTextForField: | (AGSPopupField *) | popupField |
Returns a string that you can display in the UI for informing the user of the valid range for numeric input. Only returns a non-nil value for when there is a range domain associated with the field.
- (BOOL) startEditing |
Starts editing of the popup. This does some work, like copying the original attributes, etc.
- (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: (AGSPopup)
to evaluate the Arcade expressions before trying to get the NSString
for templated string, otherwise it may return an empty string.
templatedString | The templated string. |
- (BOOL) updateFeatureTypeWithTemplate: | (nullable AGSFeatureTemplate *) | featureTemplate | |
changeMode: | (AGSPopupFeatureTypeChangeMode) | changeMode | |
validationError: | (NSError **) | validationError | |
Update the feature type of the AGSGeoElement associated with the popup. Returns YES
if the new value passes validation.
- (BOOL) updateValue: | (nullable id) | newValue | |
field: | (AGSPopupField *) | popupField | |
validationError: | (NSError **) | validationError | |
Update the value of a field in the AGSGeoElement associated with the popup. This function expects you to pass at least the correct type of value for the field. The only exception to that is that you can pass a string for numeric fields and this function will do the work of converting it to the appropriate number type for the specified field. Returns YES
if the new value passes validation.
- (nullable NSError*) validationErrorForField: | (AGSPopupField *) | popupField |
Gets the validation error, if any, currently associated with an AGSPopupField.
- (nullable NSError*) validationWarningForField: | (AGSPopupField *) | popupField |
Gets the validation warning, if any, currently associated with an AGSPopupField.
- (nullable id) valueForField: | (AGSPopupField *) | popupField |
Returns the attribute value for a given field.
If the field is part of an AGSCodedValueDomain
, the AGSCodedValue::code
is returned (unlike AGSPopup::formattedValueWithPopupField:
, which returns the AGSCodedValue::name
).
popupField | The popup field. |
- (nullable id) valueForFieldName: | (NSString *) | fieldName | |
popupElement: | (AGSPopupElement *) | popupElement | |
Returns the attribute value for the field specified by a name.
If any field is using expressions, use evaluateExpressionsWithCompletion:
to evaluate the Arcade expressions before trying to get the fields' values. Otherwise, the values may not be evaluated properly.
If the field is part of an AGSCodedValueDomain
, the AGSCodedValue::code
is returned (unlike formattedValueForField:
, which returns the AGSCodedValue::name
).
fieldName | The name of the field. |
popupElement | The pop-up element to look up for the field. This argument is useful only if the pop-up element is coming from an Arcade expression evaluation that can return a list of attributes (see AGSPopupManager::evaluatedElements ). |
|
readnonatomicstrong |
The attachment manager for this popup
|
readnonatomiccopy |
A dictionary of field group names and their associated contingent-values validation errors. Errors are reported in validation if editing is defined as restrictive in the AGSFieldGroup
.
|
readnonatomiccopy |
A dictionary of field group names and their associated contingent-values validation warnings. Warnings are reported in validation when editing is defined as non-restrictive in the AGSFieldGroup
.
|
readnonatomicstrong |
The current sketch editor that is used for editing the geometry of the popup. This is used for the AGSPopupManager to determine when the geometry of the popup being edited changes. This allows the AGSPopupManager to set the validity of the geoElement accordingly.
|
readnonatomiccopy |
The text to display as the custom HTML description. If AGSPopupDefinition::expressions
is not empty then the custom HTML description may be using expressions with Arcade FeatureSet functions. Use evaluateExpressionsWithCompletion:
to evaluate the Arcade expressions before trying to get the AGSPopupManager::customDescriptionHTML
, otherwise it may not return the correct description.
|
readwritenonatomicweak |
A delegate of the popup manager that is notified about changes in the popup state or validity.
|
readnonatomiccopy |
Convenience for getting the AGSPopupFields that are for viewing
|
readnonatomiccopy |
Convenience for getting the popup fields that are editable
|
readnonatomicassign |
Whether or not currently in editing mode
|
readnonatomiccopy |
The edit summary text.
|
readnonatomiccopy |
An array of AGSPopupElement
objects evaluated asynchronously by evaluateExpressionsWithCompletion:
.
During the evaluation, each AGSExpressionPopupElement
is replaced by the AGSPopupElement
returned by the Arcade expression and each placeholder is replaced by its value. If the Arcade expression returns a list of attributes to be used by the pop-up element, these attributes will be used by formattedValueForField:
and valueForField:
.
The array is empty while evaluateExpressionsWithCompletion:
has not been executed, and is cleared if evaluateExpressionsWithCompletion:
is executed more than once. After evaluation, the order of the pop-up elements in the array matches the order elements present in AGSPopupDefinition::elements
and shown in the pop-up window. If an AGSExpressionPopupElement
fails to be evaluated, then it will be skipped in the array. Use the array of AGSPopupExpressionEvaluation
returned from evaluateExpressionsWithCompletion:
to learn the cause of the error.
|
readnonatomicstrong |
The current AGSFeatureType, if any, of the AGSGeoElement
|
readnonatomicassign |
A Boolean value indicating whether the geoelement is in a valid state as far as the values it has set in its attributes and its geometry.
|
readnonatomicunsafe_unretained |
The associated AGSPopup. This property is marked unsafe_unretained because it depending on how you instantiate the AGSPopupManager, the AGSPopup you pass in may be retained or not. If the AGSGeoElement associated with the popup conforms to AGSLoadable it must be loaded for the AGSPopupManager to work properly. See the individual initializers for more information.
|
readnonatomicassign |
Whether or not the popup view controller should allow deleting. Takes into account if the table allows deleting the feature and the Popup settings. Takes into account OBAC and the popup definition as well.
|
readnonatomicassign |
Whether or not the popup view controller should allow editing. Takes into account if it is a new feature. In which case even if allowEdit on the popup is false we still need to show the edit button in the popup if it's a brand new feature. Takes into account OBAC and the popup definition as well.
|
readnonatomicassign |
Whether or not the popup view controller should allow editing the attachments. Takes into account the popupDefinition.showAttachments and if we have an attachment manager and if the layer actually has attachments.
|
readnonatomicassign |
Whether or not the popup view controller should allow editing the geometry. Takes into account if we are creating a new geometry, if dealing with only a table, etc. Takes into account OBAC and the popup definition as well.
|
readnonatomicassign |
Whether or not the popup view controller should show the attachments. Takes into account the popupDefinition.showAttachments and if we have an attachment manager and if the layer actually has attachments.
|
readnonatomicassign |
Whether or not the popup view controller should show the custom description HTML.
|
readnonatomicassign |
Whether or not the popup view controller should show the edit info summary.
|
readnonatomicassign |
Whether or not the popup view controller should show the media.
|
readnonatomicstrong |
Symbol used by the popup's geoelement.
|
readnonatomiccopy |
The text to display as the popup title.