This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Character { | |
var scalrValue: UInt32 { | |
return String(self).unicodeScalars.first!.value | |
} | |
var isChineseCharacter: Bool { | |
switch self.scalrValue { | |
case 0x4E00...0x9FFF, 0x3400...0x4DBF, 0x20000...0x2A6DF, 0x2A700...0x2B73F: return true | |
default: return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Listener.swift | |
// BMKP | |
// | |
// Created by lyj on 19/01/2017. | |
// Copyright © 2017 bmkp. All rights reserved. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSAttributeString+extension.swift | |
// BMKP | |
// | |
// Created by lyj on 13/03/2017. | |
// Copyright © 2017 bmkp. All rights reserved. | |
// | |
import Foundation | |
import UIKit |