| tags: [ iOS CFString Swift ] categories: [ Strings NSStringTransform ]
New iOS9 String Transformations API
String transformations formerly done using CFStringTransform a part of Core Foundation Framework. In iOS 9 string transformation can be done along with the new “NSStringTransform*” constants a native Cocoa API and no need to deal with bridging to CFStringRef.
Here are some of my favorite transformations that can be done with the new NSStringTransform* API.
print("roger".stringByApplyingTransform(NSStringTransformLatinToGreek, reverse: false)!)
//ῤογερ
print("roger".stringByApplyingTransform(NSStringTransformLatinToHangul, reverse: false)!)
//로겔
print("\uD83D\uDC2E".stringByApplyingTransform(NSStringTransformToUnicodeName, reverse: false)!)
//{COW FACE}