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中显示它吗?