ArcGIS Runtime SDK for macOS: <AGSPopupsViewControllerDelegate> Protocol Reference
ArcGIS Runtime SDK for macOS  100.5
<AGSPopupsViewControllerDelegate> Protocol Reference

Description

A protocol that must be adopted by any class wishing to be notified when AGSPopupsViewController detects user interaction with popups or if a user tries to edit a popup. An instance of the class must then be set as AGSPopupsViewController::delegate .

All methods of this protocol are optional.

Since
100

Instance Methods

(void) - popupsViewController:didCancelEditingForPopup:
 
(void) - popupsViewController:didChangeFeatureTypeForPopup:
 
(void) - popupsViewController:didChangeToCurrentPopup:
 
(void) - popupsViewController:didDeleteForPopup:
 
(void) - popupsViewController:didFailToDeleteForPopup:withError:
 
(void) - popupsViewController:didFailToFinishEditingForPopup:withError:
 
(void) - popupsViewController:didFinishEditingForPopup:
 
(void) - popupsViewController:didStartEditingForPopup:
 
(void) - popupsViewController:readyToEditGeometryWithSketchEditor:forPopup:
 
(nullable AGSSketchEditor *) - popupsViewController:sketchEditorForPopup:
 
(void) - popupsViewController:validityChanged:forPopup:
 
(BOOL) - popupsViewController:wantsToDeleteForPopup:
 
(void) - popupsViewController:wantsToPreviewDocumentAtURL:fromViewController:atRect:
 
(void) - popupsViewController:willFinishEditingForPopup:
 
(void) - popupsViewControllerDidFinishViewingPopups:
 

Method Documentation

§ popupsViewController:didCancelEditingForPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didCancelEditingForPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when the user cancels editing the current popup.

Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> was started to be edited but later canceled
Since
100

§ popupsViewController:didChangeFeatureTypeForPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didChangeFeatureTypeForPopup: (AGSPopup *)  popup 
optional

The AGSPopupsViewController will call this when the user switches a feature type for the current popup. Potentially at this point symbology will change for the feature. Currently this is only called for AGSArcGISFeature popups.

Since
100

§ popupsViewController:didChangeToCurrentPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didChangeToCurrentPopup: (AGSPopup *)  popup 
optional

The AGSPopupsViewController will call this method when the currently showing popup changes.

Parameters
popupsViewControllerThe popup view controller
popupwhich is currently being displayed
Since
100

§ popupsViewController:didDeleteForPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didDeleteForPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when a id<AGSGeoElement> was successfully deleted.

Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> was deleted
Since
100

§ popupsViewController:didFailToDeleteForPopup:withError:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didFailToDeleteForPopup: (AGSPopup *)  popup
withError: (NSError *)  error 
optional

The method called by the AGSPopupsViewController when it fails to delete a id<AGSGeoElement>. If you do not implement this method then AGSPopupsViewController will show an alert to the user with the error. If you do implement this method then you are responsible for bubbling up the error to the user.

Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> was meant to be deleted
errorthat occurred
Since
100

§ popupsViewController:didFailToFinishEditingForPopup:withError:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didFailToFinishEditingForPopup: (AGSPopup *)  popup
withError: (NSError *)  error 
optional

The method called by the AGSPopupsViewController when the user tries to finish editing but errors were encountered. If you implement this method then you are responsible for showing any UI that should be shown when an editing error occurs. If you do not implement this method the AGSPopupsViewController will show an alert depicting the localized description of the error.

Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> was edited
errorthat occurred when trying to finish editing
Since
100

§ popupsViewController:didFinishEditingForPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didFinishEditingForPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when the user is done editing the current popup.

Note
This is where you might make the appropriate calls to keep the server in sync with the client. For example, you might call applyEditsWithCompletion if dealing with AGSArcGISFeature objects.
Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> was edited
Since
100

§ popupsViewController:didStartEditingForPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
didStartEditingForPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when the user begins editing the current popup.

Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> needs to be edited
Since
100

§ popupsViewController:readyToEditGeometryWithSketchEditor:forPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
readyToEditGeometryWithSketchEditor: (nullable AGSSketchEditor *)  sketchEditor
forPopup: (AGSPopup *)  popup 
optional

Tells the delegate that a user is ready to edit the geometry for the current popup. This will happen when the user clicks the toolbar item for editing the geometry. Or if the editing mode is "Geometry Inline", it will happen when editing begins. The sketchEditor is the sketchEditor that was earlier passed to the popupsViewController through the popupsViewController:sketchEditorForPopup: delegate method. If you want to make programmatic changes to the popup's geometry, you should go through this sketchEditor. This allows the popupsViewController to know when the geometry changes so that it can update it's UI appropriately (ie. enabling the "Done" button).

Parameters
popupsViewControllerThe popup view controller
sketchEditorThe sketchEditor that should be used for editing a popup's geometry.
popupwhose id<AGSGeoElement>'s geometry needs to be edited
Since
100

§ popupsViewController:sketchEditorForPopup:()

- (nullable AGSSketchEditor*) popupsViewController: (AGSPopupsViewController *)  popupsViewController
sketchEditorForPopup: (AGSPopup *)  popup 
optional

Tells the delegate that a sketch editor is required for an AGSPopup. The popupsViewController will listen for changes to the AGSSketchEditor to determine when the geometry is in a valid state. Depending upon the type of geometry (point, polygon, polyline, etc) required for the id<AGSGeoElement>, the delegate must return a sketch editor for editing the appropriate type of geometry. At this point the sketchEditor should be started and assigned to the appropriate AGSMapView.

Parameters
popupsViewControllerThe popup view controller
popupPopup of the id<AGSGeoElement> for which a sketchEditor is required.
Since
100

§ popupsViewController:validityChanged:forPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
validityChanged: (BOOL)  isValid
forPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when a popup's validity is changed. This happens when the geometry or attributes of the popup's id<AGSGeoElement> are changed. isValid will be YES if it is determined that a id<AGSGeoElement> meets it's requirements to be saved to it's datasource. This method is useful if you have your own "finish editing" button and you want to enable/disable it when the id<AGSGeoElement> is valid.

Parameters
popupsViewControllerThe popup view controller
isValidWhether or not the id<AGSGeoElement> meets it's known requirements to be saved to it's datasource.
Since
100

§ popupsViewController:wantsToDeleteForPopup:()

- (BOOL) popupsViewController: (AGSPopupsViewController *)  popupsViewController
wantsToDeleteForPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when the user confirms they want to delete the id<AGSGeoElement>. The implementer of this method must actually delete the id<AGSGeoElement>.

Note
This method will only be called for popups with a id<AGSGeoElement> that we don't know how to delete. Currently, the popup only knows how to delete AGSArcGISFeature objects. This method will be called for all other types of id<AGSGeoElement> objects.
Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> needs to be deleted
Returns
Whether or not the popup was successfully deleted
Since
100

§ popupsViewController:wantsToPreviewDocumentAtURL:fromViewController:atRect:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
wantsToPreviewDocumentAtURL: (NSURL *)  documentURL
fromViewController: (AGSViewController *)  fvc
atRect: (CGRect)  rect 
optional

The AGSPopupsViewController will call this method when there is a document that it wants to preview. By default, if this method is not implemented, it will preview the document with a UIDocumentInteractionController. If you have need to hide or show popovers before previewing you should implement this method and create the UIDocumentInteractionController manually.

Since
100

§ popupsViewController:willFinishEditingForPopup:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
willFinishEditingForPopup: (AGSPopup *)  popup 
optional

The method called by the AGSPopupsViewController when the user is done editing the current popup. This method is called before popupsViewController:didFinishEditingForPopup and it is also called before feature updates are submitted to its table (when dealing with AGSFeature objects).

Parameters
popupsViewControllerThe popup view controller
popupwhose id<AGSGeoElement> was edited
Since
100.3

§ popupsViewControllerDidFinishViewingPopups:()

- (void) popupsViewControllerDidFinishViewingPopups: (AGSPopupsViewController *)  popupsViewController
optional

The method that is called when the user is done viewing the popups.

Parameters
popupsViewControllerThe popup view controller
Since
100