Display japanese Text with furigana in UILabel
for my app, few month ago, i've take the code from this site to use CTRubyAnnotation. This code, with few changes to make work with swift 4, work perfectly. from this work I've create a class in which I written a function to use that code. this is the class in swift 4 import UIKit extension String { func find(pattern: String) -> NSTextCheckingResult? { do { let re = try NSRegularExpression(pattern: pattern, options: []) return re.firstMatch( in: self, options: [], range: NSMakeRange(0, self.utf16.count)) } catch { return nil } } func replace(pattern: String, template: String) -> String { do {