FUITakePhotoAttachmentAction

open class FUITakePhotoAttachmentAction : FUIAttachmentAction

This class is an implementation of FUIAttachmentAction to allow the user to use the camera to take a photo as an attachment in FUIAttachmentsFormView.

This action requires camera usage permission from the user. If isSavedToCameraRoll property is true, the Photo Library usage permission is also required.

  • The title string to be displayed for this action.

    Declaration

    Swift

    public let title: String
  • An implementation of FUITakePhotoAttachmentActionDelegate.

    Declaration

    Swift

    open weak var delegate: FUITakePhotoAttachmentActionDelegate?
  • Indicates if the photo taken should be saved to the camera roll or not. If this is false, developers need to manage the returned photo images.

    The default is true.

    Declaration

    Swift

    open var isSavedToCameraRoll: Bool
  • The types of media that are allowed.

    Use this property to customize the media types allowed for this attachment action.

    If this is not specified, the default is:

    [kUTTypeMovie as String, kUTTypeImage as String]
    

    This means both video and photo are allowed to be chosen.

    Constants kUTTypeMovie and kUTTypeImage are defined in MobileCoreServices.

    Declaration

    Swift

    open var mediaTypes: [String]?
  • Returns a newly initialized FUITakePhotoAttachmentAction.

    Declaration

    Swift

    public init(withTitle title: String? = nil)

    Parameters

    title

    The title string for this action. If this is not specified, the default title “Take Photo” will be used.

  • A camera view will be shown for user to take a photo as an attachment.

    Declaration

    Swift

    open func action(onController controller: FUIAttachmentsViewController)

    Parameters

    controller

    The FUIAttachmentsFormViewController.

  • Check if camera is supported and its usage permission has not been denied.

    Declaration

    Swift

    open func isAvailable(_ alertAction: UIAlertAction) -> Bool

    Return Value

    True if camera is available and its usage permission has not been denied.