swift 更改 UIAlertController.UIAlertAction字体颜色

        let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
        let copyAction = UIAlertAction(title: "复制", style: .default, handler: { action in
            let pasteboard = UIPasteboard.general
            pasteboard.string = model.contents
        })
        copyAction.setValue(UIColor(hexString: "4a4a4a", alpha: 1), forKey: "_titleTextColor")
        alertController.addAction(copyAction)
        
        let destructiveAction = UIAlertAction(title: "回复", style: .default, handler: { [weak self] action in
            self?.selectSection = section
            self?.growingTextView.becomeFirstResponder()
        })
        destructiveAction.setValue(UIColor(hexString: "#4a4a4a", alpha: 1), forKey: "_titleTextColor")
        alertController.addAction(destructiveAction)
        present(alertController, animated: true, completion: nil)

你可能感兴趣的:(swift 更改 UIAlertController.UIAlertAction字体颜色)