Skip to content

Instantly share code, notes, and snippets.

View YesCoach's full-sized avatar

Taehyun Park YesCoach

View GitHub Profile
@krummler
krummler / String+EmojiCheck.swift
Last active September 3, 2024 11:40
Emoji Checking for Swift 5.0 and up
import Foundation
extension Character {
/// A simple emoji is one scalar and presented to the user as an Emoji
var isSimpleEmoji: Bool {
return unicodeScalars.count == 1 && unicodeScalars.first?.properties.isEmojiPresentation ?? false
}
/// Checks if the scalars will be merged into and emoji
var isCombinedIntoEmoji: Bool {