zoukankan      html  css  js  c++  java
  • 发布emoji

    - (NSString *)fullStr// 在UITextView中的需要发送的文字文字

    {

        NSMutableString *fullText = [[NSMutableString alloc] init];

            [self.attributedText enumerateAttributesInRange:NSMakeRange(0, self.attributedText.length) options:0 usingBlock:^(NSDictionary<NSString *,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {

            YSWeiBoNSTextAttachment *attachment = attrs[@"NSAttachment"];// 是否为图片

            if (attachment)// 如果是表情图片

            {

                [fullText appendString:[NSString stringWithFormat:@"%@",attachment.emotion.chs]];// 获取文字对应的描述字符串

            }

            else

            {

                NSAttributedString *attributedString = [self.attributedText attributedSubstringFromRange:range];

                [fullText appendString:attributedString.string];

            }

        }];

        

        return fullText;

    }

  • 相关阅读:
    Pika的设计及实现
    高性能网络编程
    C语言的结构体
    消息队列库——ZeroMQ
    Diffie-Hellman密钥交换算法
    mysql-proxy 读写分离
    位运算
    分布式学习之一:事务
    Redis Cluster
    SpringBoot整合ActiveMQ,看这篇就够了
  • 原文地址:https://www.cnblogs.com/happyEveryData/p/5524796.html
Copyright © 2011-2022 走看看