change string with picture in swift
问题 I have a String in a UILabel and this string includes one or several emoji but only the name like ":cool:" or ":crazy:". How can I replace the word in the String with the .png ? func checkString(pString: String) -> String { var replaced = pString //get the String var found = "" var image = UIImage() //Emoji for i in 1...bib.count { //bib = array(Int:String) with all names of the Emoji if pString.range(of: bib[i]!) != nil { found = bib[I]! //picBib is a array(String:String) with the Emoji name