ArcGIS Runtime SDK for macOS: AGSPopupManager Class Reference
ArcGIS Runtime SDK for macOS  100.5
AGSPopupManager Class Reference

Description

Instances of this class represent a popup manager that contains the necessary business logic for displaying and editing popup information for geo-elements. This class is useful, for instance, if you want to create your own View Controller for displaying AGSPopup instead of using AGSPopupsViewController.

Since
100
Inheritance diagram for AGSPopupManager:

Instance Methods

(void) - cancelEditing
 
(nullable AGSDomain *) - domainForField:
 
(BOOL) - featureTypeChangeRequiresUserNoficationForTemplate:
 
(BOOL) - featureTypeChangeRequiresUserNotificationForTemplate:
 
(nullable AGSPopupField *) - fieldForName:
 
(BOOL) - fieldIsNullable:
 
(BOOL) - fieldIsTypeIDField:
 
(AGSFieldType- fieldTypeForField:
 
(void) - finishEditingWithCompletion:
 
(NSString *) - formattedValueForField:
 
(instancetype) - initWithPopup:
 
(NSString *) - labelForField:
 
(NSInteger) - lengthForField:
 
(nullable NSNumber *) - numberFromString:field:
 
(nullable NSNumber *) - numberFromString:field:error:
 
(nullable NSString *) - rangeValidationTextForField:
 
(BOOL) - startEditing
 
(nullable NSString *) - stringForTemplatedString:
 
(BOOL) - updateFeatureTypeWithTemplate:changeMode:validationError:
 
(BOOL) - updateValue:field:validationError:
 
(nullable NSError *) - validationErrorForField:
 
(nullable id) - valueForField:
 

Properties

AGSPopupAttachmentManagerattachmentManager
 
AGSSketchEditorcurrentSketchEditor
 
NSString * customDescriptionHTML
 
id< AGSPopupManagerDelegatedelegate
 
NSArray< AGSPopupField * > * displayFields
 
NSArray< AGSPopupField * > * editableDisplayFields
 
BOOL editing
 
NSString * editSummary
 
AGSFeatureTypefeatureType
 
BOOL geoElementValid
 
AGSPopuppopup
 
BOOL shouldAllowDelete
 
BOOL shouldAllowEdit
 
BOOL shouldAllowEditAttachments
 
BOOL shouldAllowEditGeometry
 
BOOL shouldShowAttachments
 
BOOL shouldShowCustomDescriptionHTML
 
BOOL shouldShowEditSummary
 
BOOL shouldShowMedia
 
AGSSymbolsymbol
 
NSString * title
 

Method Documentation

§ cancelEditing()

- (void) cancelEditing

Cancels the editing of the popup. This rolls the AGSGeoElement back to it's original state.

Since
100

§ domainForField:()

- (nullable AGSDomain*) domainForField: (AGSPopupField *)  popupField

Returns the AGSDomain associated with a given AGSPopupField

Since
100

§ featureTypeChangeRequiresUserNoficationForTemplate:()

- (BOOL) featureTypeChangeRequiresUserNoficationForTemplate: ("Please use featureTypeChangeRequiresUserNotificationForTemplate:")  __deprecated_msg

Method you can call to determine if you need to notify the user when a AGSFeatureType is going to change.

Parameters
featureTemplateThe template that the user wants to change to.
Since
100
Deprecated:
100.1. Use #featureTypeChangeRequiresUserNotificationForTemplate instead

§ featureTypeChangeRequiresUserNotificationForTemplate:()

- (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.

Parameters
featureTemplateThe template that the user wants to change to.
Since
100.1

§ fieldForName:()

- (nullable AGSPopupField*) fieldForName: (NSString *)  fieldName

Returns the AGSPopupField for a given field name.

Since
100

§ fieldIsNullable:()

- (BOOL) fieldIsNullable: (AGSPopupField *)  popupField

Returns whether or not a given AGSPopupField allows null values.

Since
100

§ fieldIsTypeIDField:()

- (BOOL) fieldIsTypeIDField: (AGSPopupField *)  popupField

Returns whether or not a given AGSPopupField is the TypeID field.

Since
100

§ fieldTypeForField:()

- (AGSFieldType) fieldTypeForField: (AGSPopupField *)  popupField

Returns the field type for a given AGSPopupField.

Since
100

§ finishEditingWithCompletion:()

- (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.

Since
100

§ formattedValueForField:()

- (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.

Since
100

§ initWithPopup:()

- (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.

Since
100

§ labelForField:()

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

Returns a user-friendly display name for the provided popup field

Since
100.3

§ lengthForField:()

- (NSInteger) lengthForField: (AGSPopupField *)  popupField

Returns the field length given an AGSPopupField.

Since
100

§ numberFromString:field:()

- (nullable NSNumber*) numberFromString: (NSString *)  stringValue
field: ("Please use numberFromString:field:error:")  __deprecated_msg 

Creates correct number type from a string. Uses the AGSPopupField to determine type of number to return (int, double, etc)

Since
100
Deprecated:
100.1. Use numberFromString:field:error: instead.

§ numberFromString:field:error:()

- (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.

Since
100.1

§ rangeValidationTextForField:()

- (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.

Since
100

§ startEditing()

- (BOOL) startEditing

Starts editing of the popup. This does some work, like copying the original attributes, etc.

Since
100

§ stringForTemplatedString:()

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

Substitutes attribute templates in a string with actual values.

Since
100

§ updateFeatureTypeWithTemplate:changeMode:validationError:()

- (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.

Since
100

§ updateValue:field:validationError:()

- (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.

Since
100

§ validationErrorForField:()

- (nullable NSError*) validationErrorForField: (AGSPopupField *)  popupField

Gets the validation error, if any, currently associated with an AGSPopupField.

Since
100

§ valueForField:()

- (nullable id) valueForField: (AGSPopupField *)  popupField

Returns the actual value that is in the AGSGeoElement for a given AGSPopupField. This method is "safe" (returns nil instead of NSNull)

Since
100

Property Documentation

§ attachmentManager

- (AGSPopupAttachmentManager*) attachmentManager
readnonatomicstrong

The attachment manager for this popup

Since
100

§ currentSketchEditor

- (AGSSketchEditor*) currentSketchEditor
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.

Since
100

§ customDescriptionHTML

- (NSString*) customDescriptionHTML
readnonatomiccopy

The text to display as the custom HTML description.

Since
100

§ delegate

- (id<AGSPopupManagerDelegate>) delegate
readwritenonatomicweak

A delegate of the popup manager that is notified about changes in the popup state or validity.

Since
100

§ displayFields

- (NSArray<AGSPopupField*>*) displayFields
readnonatomiccopy

Convenience for getting the AGSPopupFields that are for viewing

Since
100

§ editableDisplayFields

- (NSArray<AGSPopupField*>*) editableDisplayFields
readnonatomiccopy

Convenience for getting the popup fields that are editable

Since
100

§ editing

- (BOOL) editing
readnonatomicassign

Whether or not currently in editing mode

Since
100

§ editSummary

- (NSString*) editSummary
readnonatomiccopy

The edit summary text.

Since
100

§ featureType

- (AGSFeatureType*) featureType
readnonatomicstrong

The current AGSFeatureType, if any, of the AGSGeoElement

Since
100

§ geoElementValid

- (BOOL) geoElementValid
readnonatomicassign

Whether or not the AGSGeoElement is in a valid state as far as the values it has set in its attributes and it's geometry.

Since
100

§ popup

- (AGSPopup*) popup
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.

Since
100

§ shouldAllowDelete

- (BOOL) shouldAllowDelete
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.

Since
100

§ shouldAllowEdit

- (BOOL) shouldAllowEdit
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.

Since
100

§ shouldAllowEditAttachments

- (BOOL) shouldAllowEditAttachments
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.

Since
100

§ shouldAllowEditGeometry

- (BOOL) shouldAllowEditGeometry
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.

Since
100

§ shouldShowAttachments

- (BOOL) shouldShowAttachments
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.

Since
100

§ shouldShowCustomDescriptionHTML

- (BOOL) shouldShowCustomDescriptionHTML
readnonatomicassign

Whether or not the popup view controller should show the custom description HTML.

Since
100

§ shouldShowEditSummary

- (BOOL) shouldShowEditSummary
readnonatomicassign

Whether or not the popup view controller should show the edit info summary.

Since
100

§ shouldShowMedia

- (BOOL) shouldShowMedia
readnonatomicassign

Whether or not the popup view controller should show the media.

Since
100

§ symbol

- (AGSSymbol*) symbol
readnonatomicstrong

Symbol used by the popup's geo-element

Since
100

§ title

- (NSString*) title
readnonatomiccopy

The text to display as the popup title.

Since
100