Documentation for MapLib/AttributesView.swift

protocol AttachmentDelegate : class

Attachments delegate class

func onAttachment(attachment: Attachment?)

Executes when attachment clicked/touched.

Parameters
  • attachment – Attachment clicked/touched.

func onAddAttachment()

Executes when attachment add.

class AttributesView : UIScrollView

Attributes view. Shows feature attributes.

var showUnsetFields : Bool = false

Show not set fields. Default is false.

var isSectionUppercased = true

Section labels uppercased or not. Default is true.

var labelColor : UIColor = UIColor.black

Label color. Default is black.

var labelSize : CGFloat = 13.0

Label size. Default 13.

var textColor : UIColor = UIColor.black

Text color. Default is black.

var textSize : CGFloat = 16.0

Text size. Default is 16.

var sectionTextColor : UIColor = UIColor.black

Section text color. Default is black.

var sectionTextSize : CGFloat = 13.0

Section text size. Default value is 13.

var attachmentImage : UIImage = nil

Attachment icon image.

var attachmentRemoteImage : UIImage = nil

Attachment icon image if file is not exists in file system.

var attachmentDelegate : AttachmentDelegate? = nil

Attachments operation delegate.

func fill(feature: Feature)

Fill controls with values from feature.

Parameters
  • feature – Feature class instance.

func addAttachment(_ attachment:Attachment)

Add attachment to this view.

Parameters
  • attachment – Attachment class instance.

func addFieldLabel(_ feature:Feature, _ field:Field, _ pos:Int32)

Add field label.

Parameters
  • feature – Feature class instance.

  • field – Field class instance.

  • pos – Field position if table or feature class.

func addSection(_ name:String)

Add section with name.

Parameters
  • name – Section name.

class AttributesEditView : AttributesView, UITextFieldDelegate

Attributes view with edit capabilities.

var attachmentBtnColor : UIColor = UIColor.blue

Attachment button color.

var attachmentBtnImage : UIImage = nil

Attachment button image.

var delAttachmentBtnImage : UIImage = nil

Delete attachment button image.

var hasEdits : Bool = false

Mark if any attribute edits were in view.

func addFieldEdit(_ feature:Feature, _ field:Field, _ pos:Int32)

Add field edit control.

Parameters
  • feature – Feature clas instance.

  • field – Field class instance.

  • pos – Field position in fields atrray.

func addAttachmentEdit(_ attachment:Attachment)

Add attachment with delete button.

Parameters
  • attachment – Attachment class instance.

func addAttachmentBtn()

Add “add attachment” button to view.

func textFieldShouldBeginEditing(_ textField:UITextField) Bool

Executes while text field begin editint. Used by calendar control.

Parameters
  • textField – Text field class instance.

Returns

true if editing available or false to prevent editing.

func save(feature: Feature) Bool

Save edits to feature in FeatureClass/Table.

Parameters
  • feature – Feature class instance.

Returns

True on success.

func addAttachment(name: String, path: String)

Add new attachment to view

Parameters
  • name – Attachment name

  • path – File system path to attachment file.