Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.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 如何在文本字段中分离(通过默认键盘)输入的表情符号_Ios_Swift_Emoji - Fatal编程技术网

Ios 如何在文本字段中分离(通过默认键盘)输入的表情符号

Ios 如何在文本字段中分离(通过默认键盘)输入的表情符号,ios,swift,emoji,Ios,Swift,Emoji,我在文本字段中输入了两个表情符号,以更新Swift 4(Xcode 9) 从Swift 4开始(使用Xcode 9 beta测试),一个“表情符号ZWJ序列”是 按照Unicode 9标准的规定,被视为单个字符: let str = "You can use this code example or this pod. To use it in Swift, import the category into the YourProject_Bridging_Header #import "

我在文本字段中输入了两个表情符号,以更新Swift 4(Xcode 9)

从Swift 4开始(使用Xcode 9 beta测试),一个“表情符号ZWJ序列”是 按照Unicode 9标准的规定,被视为单个
字符

let str = "You can use this code example or this pod. 

To use it in Swift, import the category into the
YourProject_Bridging_Header

#import "NSString+EMOEmoji.h"
let str=“您可以使用此代码或此

要在Swift中使用它,请将类别导入
YourProject\u bridgeting\u标题中

然后可以检查字符串中每个表情符号的范围:


举个例子:NSString=“嗨,马丁。首先,非常感谢你的回答。正如您所说,在某些情况下,这是行不通的,但我尝试了您的代码,它工作得很好。这是我的带有多个标志的完整字符串[“我也用标志尝试了这种逻辑,对于几个不同的标志它工作得很好。@KiranJasvanee:Swift 4(目前为beta版)“问题”已经解决。