another.im-ios/Monal/Classes/MLEmoji.swift

28 lines
534 B
Swift
Raw Permalink Normal View History

2024-11-18 14:53:52 +00:00
//
// MLEmoji.swift
// monalxmpp
//
// Created by Anurodh Pokharel on 3/29/21.
// Copyright © 2021 Monal.im. All rights reserved.
//
import Foundation
@objcMembers
public class MLEmoji: NSObject
{
public static func containsEmoji(text:String) -> Bool
{
for scalar in text.unicodeScalars
{
let isEmoji = scalar.properties.isEmoji && scalar.properties.isEmojiPresentation
if(!isEmoji)
{
return false
}
}
return true
}
}