Skip to content

Instantly share code, notes, and snippets.

View heronlyj's full-sized avatar
🏸
Focusing

YONGJIE heronlyj

🏸
Focusing
View GitHub Profile
@heronlyj
heronlyj / NSAttributeString+extension.swift
Last active May 5, 2018 05:45
NSAttributeString+extension
//
// NSAttributeString+extension.swift
// BMKP
//
// Created by lyj on 13/03/2017.
// Copyright © 2017 bmkp. All rights reserved.
//
import Foundation
import UIKit
@heronlyj
heronlyj / Listener.swift
Last active May 5, 2018 07:23
一个轻量的数据监听类
//
// Listener.swift
// BMKP
//
// Created by lyj on 19/01/2017.
// Copyright © 2017 bmkp. All rights reserved.
//
import Foundation
@heronlyj
heronlyj / SwiftChineseCharacter.swift
Last active October 6, 2016 03:14
Swift Separate Chinese Character
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