Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIAlertController中的默认首字母大写_Ios_Swift - Fatal编程技术网

Ios UIAlertController中的默认首字母大写

Ios UIAlertController中的默认首字母大写,ios,swift,Ios,Swift,当我显示UIAlertController时,是否有办法将第一个字母默认为大写 var alertController = UIAlertController(title: i18nEnterPersonName, message: nil, preferredStyle: .Alert) // initialization of alertController... presentViewController(alertController, animated: true, completio

当我显示
UIAlertController
时,是否有办法将第一个字母默认为大写

var alertController = UIAlertController(title: i18nEnterPersonName, message: nil, preferredStyle: .Alert)
// initialization of alertController...
presentViewController(alertController, animated: true, completion: nil)
这样做:

 let alertMessage = "i18nEnterPersonName".capitalizedString
 var alertController = UIAlertController(title: alertMessage, message: nil, preferredStyle: .Alert)
如果i18nEnterPersonName是变量(我认为它是一个字符串),那么执行以下操作:

 var alertController = UIAlertController(title: i18nEnterPersonName.capitalizedString, message: nil, preferredStyle: .Alert)

将大写字符串与字符串一起使用,但您知道如何在UIAlertController中显示它吗?