Yatko Yatko - 4 months ago 54
Swift Question

Emoji in iOS app Alerts and Notifications - Xcode/Swift

I'm trying to add an emoji to an alert in Xcode but can't figure it out, any help is greatly appreciated! \xF0\x9F\x98\xB3

Code:

if ((self.liveStreamTitle.text?.characters.count) == 0)
{

let alertView = UIAlertController.init(title: "Forgot something?", message: "Video Title is empty EMOJIHERE", preferredStyle: UIAlertControllerStyle.Alert)
alertView.addAction(UIAlertAction.init(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alertView, animated: true, completion: {

})

return;

}

Answer

Why don't you just add it directly?

@IBAction func pressed(sender: AnyObject) {

let actionSheetController: UIAlertController = UIAlertController(title: "Are you sure?", message: "", preferredStyle: .Alert)
let cancelAction: UIAlertAction = UIAlertAction(title: "
Comments