0

My scenario, I am trying to create UIActionSheet with Left side Icon and Title Left Alignment with Right Side check mark selection. Here, I am using below code for adding Image I can't able to reduce size of the Image also Text Left alignment and check mark. How to do this?

My Code Below

let actionSheetAlertController: UIAlertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)

    let cancelActionButton = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
    actionSheetAlertController.addAction(cancelActionButton)


    let documentsActionButton = UIAlertAction(title: "Documents", style: .default, handler: nil)
    actionSheetAlertController.addAction(documentsActionButton)
    documentsActionButton.setValue(#imageLiteral(resourceName: "profile"), forKey: "image")
    documentsActionButton.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment")

    let cameraActionButton = UIAlertAction(title: "Camera", style: .default, handler: nil)
    actionSheetAlertController.addAction(cameraActionButton)
    cameraActionButton.setValue(#imageLiteral(resourceName: "profile"), forKey: "image")
    cameraActionButton.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment")

    let galleryActionButton = UIAlertAction(title: "Gallery", style: .default, handler: nil)
    actionSheetAlertController.addAction(galleryActionButton)
    galleryActionButton.setValue(#imageLiteral(resourceName: "profile"), forKey: "image")
    galleryActionButton.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment")

    actionSheetAlertController.view.tintColor = UIColor .red
    self.present(actionSheetAlertController, animated: true, completion: nil)

sample Image

Ben Dev
  • 77
  • 1
  • 12

0 Answers0