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

Description

Manages attachments belonging to a popup.

Instances of this class represent a light-weight and coarse-grained object for managing attachments of a popup.

It is useful for dealing with attachments (AGSPopupAttachment) if you want to create your own View Controller for displaying popups and attachments. It is used by AGSPopupManager and available for you to use through AGSPopupManager::attachmentManager.

Since
100
Inheritance diagram for AGSPopupAttachmentManager:

Instance Methods

(nullable AGSPopupAttachment *) - addAttachmentAsJPGWithImage:name:preferredSize:
 
(AGSPopupAttachment *) - addAttachmentWithData:name:contentType:preferredSize:
 
(NSArray< AGSPopupAttachment * > *) - attachments
 
(NSString *) - basenameForNewAttachmentWithType:
 
(void) - deleteAttachment:
 
(id< AGSCancelable >) - fetchAttachmentsWithCompletion:
 
(NSArray< AGSPopupAttachment * > *) - filteredAndSortedAttachments
 
(instancetype) - initWithFeature:
 

Method Documentation

§ addAttachmentAsJPGWithImage:name:preferredSize:()

- (nullable AGSPopupAttachment*) addAttachmentAsJPGWithImage: (AGSImage *)  image
name: (NSString *)  name
preferredSize: (AGSPopupAttachmentSize preferredSize 

Add the specified image as an attachment.

Note
This edit doesn't go into the table until changes are applied to the table through finishEditingWithCompletion: (AGSPopupManager). However, the attachment will be available in attachments
Parameters
imageThe image to be added as an attachment.
nameThe name of the attachment. If uploading to ArcGIS Enterprise, the name must include the file extension.
Returns
The added popup attachment or nil if the image has no data.
Since
100

§ addAttachmentWithData:name:contentType:preferredSize:()

- (AGSPopupAttachment*) addAttachmentWithData: (NSData *)  data
name: (NSString *)  name
contentType: (NSString *)  contentType
preferredSize: (AGSPopupAttachmentSize preferredSize 

Add the specified data as an attachment.

Note
This edit doesn't go into the table until changes are applied to the table through finishEditingWithCompletion: (AGSPopupManager). However, the attachment will be available in attachments
Parameters
dataThe data to be added as an attachment.
nameThe name of the attachment. If uploading to ArcGIS Enterprise, the name must include the file extension.
contentTypeThe MIME type of the data.
Returns
The added popup attachment.
Since
100

§ attachments()

- (NSArray<AGSPopupAttachment*>*) attachments

Returns all the current attachments. Will be empty if attachments haven't yet been fetched.

Returns
popup's attachments
Since
100
See also
- fetchAttachmentsWithCompletion: to fetch - attachments

§ basenameForNewAttachmentWithType:()

- (NSString*) basenameForNewAttachmentWithType: (AGSPopupAttachmentType type

Returns the base-name for a new attachment if you need to display a recommended name for an attachment before it's added.

Since
100

§ deleteAttachment:()

- (void) deleteAttachment: (AGSPopupAttachment *)  attachment

Delete the specified attachment.

Note
This edit doesn't go into the table until changes are applied to the table through finishEditingWithCompletion: (AGSPopupManager). However, the attachment will no longer be available in attachments
Parameters
attachmentto delete
Since
100

§ fetchAttachmentsWithCompletion:()

- (id<AGSCancelable>) fetchAttachmentsWithCompletion: (nullable void(^)(NSArray< AGSPopupAttachment * > *__nullable attachments, NSError *__nullable error))  completion

Fetch the attachments that belong to the popup. Once complete then you can access the attachments.

Parameters
completionblock that is invoked when the operation completes.
Returns
operation that can be canceled
Since
100

§ filteredAndSortedAttachments()

- (NSArray<AGSPopupAttachment*>*) filteredAndSortedAttachments

Returns the attachments filtered for types that AGSPopupsViewController can display (see AGSPopupAttachmentType ) and sorted alphabetically by name. Will be empty if attachments haven't yet been fetched.

Returns
popup's attachments that are supported for display
Since
100
See also
- fetchAttachmentsWithCompletion: to fetch - attachments

§ initWithFeature:()

- (instancetype) initWithFeature: (AGSArcGISFeature *)  feature