ArcGIS Runtime SDK for iOS: <AGSPopupsViewControllerDelegate> Protocol Reference
ArcGIS Runtime SDK for iOS  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:
 
(nullable UIView *) - popupsViewController:footerViewForPopup:
 
(nullable UIView *) - popupsViewController:headerViewForPopup:
 
(void) - popupsViewController:readyToEditGeometryWithSketchEditor:forPopup:
 
(BOOL) - popupsViewController:shouldAutorotateForViewController:ofType:
 
(nullable AGSSketchEditor *) - popupsViewController:sketchEditorForPopup:
 
(void) - popupsViewController:validityChanged:forPopup:
 
(BOOL) - popupsViewController:wantsToDeleteForPopup:
 
(void) - popupsViewController:wantsToHideViewController:ofType:
 
(void) - popupsViewController:wantsToPreviewDocumentAtURL:fromViewController:atRect:
 
(void) - popupsViewController:wantsToShowViewController:ofType: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:footerViewForPopup:()

- (nullable UIView*) popupsViewController: (AGSPopupsViewController *)  popupsViewController
footerViewForPopup: (AGSPopup *)  popup 
optional

Implement this method if you want to provide a custom footer view for the popup.

Parameters
popupsViewControllerThe popup view controller
popupThe popup the footer view will display for
Since
100

§ popupsViewController:headerViewForPopup:()

- (nullable UIView*) popupsViewController: (AGSPopupsViewController *)  popupsViewController
headerViewForPopup: (AGSPopup *)  popup 
optional

Implement this method if you want to provide a custom header view for the popup.

Parameters
popupsViewControllerThe popup view controller
popupThe popup the header view will display for
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:shouldAutorotateForViewController:ofType:()

- (BOOL) popupsViewController: (AGSPopupsViewController *)  popupsViewController
shouldAutorotateForViewController: (UIViewController *)  vc
ofType: (AGSPopupViewControllerType viewType 
optional

The AGSPopupsViewController will call this delegate method when it one of it's view controllers needs to know if it can auto-rotate to a certain interface orientation. If you don't implement this method then we just always return YES.

Parameters
popupsViewControllerThe popup view controller
vcThe view controller that needs to respond to orientation change
viewTypethe predefined type of the view controller
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:wantsToHideViewController:ofType:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
wantsToHideViewController: (AGSViewController *)  vc
ofType: (AGSPopupViewControllerType viewType 
optional

The AGSPopupsViewController will call this method on the delegate when a view controller needs to be hidden. You need to implement this if you implement popupsViewController:wantsToShowViewController:fromViewController:atRect, so that you can hide a view controller in the proper way if you've shown it in a custom manner.

Parameters
popupsViewControllerThe popup view controller
vcThe view controller that needs to be hidden
viewTypethe predefined type of the view controller
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:wantsToShowViewController:ofType:fromViewController:atRect:()

- (void) popupsViewController: (AGSPopupsViewController *)  popupsViewController
wantsToShowViewController: (AGSViewController *)  svc
ofType: (AGSPopupViewControllerType viewType
fromViewController: (AGSViewController *)  fvc
atRect: (CGRect)  rect 
optional

The AGSPopupsViewController will call this method on the delegate when a view controller needs to be presented. This method is optional, but if you want to show view controllers in different ways than the standard modal way, then you need to implement this method.

Parameters
popupsViewControllerThe popup view controller
svcThe view controller that needs to be displayed
viewTypeThe predefined type of the view controller
fvcThe view controller that is currently being displayed
rectThe rect is in the coordinate space of the fromViewController. Only applicable if viewType is AGSPopupViewControllerTypeUIImagePicker
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