This file contains hidden or 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
import Foundation | |
private extension CFStringTokenizer { | |
var hiragana: String { string(to: kCFStringTransformLatinHiragana) } | |
var katakana: String { string(to: kCFStringTransformLatinKatakana) } | |
private func string(to transform: CFString) -> String { | |
var output: String = "" | |
while !CFStringTokenizerAdvanceToNextToken(self).isEmpty { | |
output.append(letter(to: transform)) |
This file contains hidden or 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
/// Adding Skeleton Animation to a UIView | |
/// Usage: view.showSkeleton(backgroundColor: UIColor.systemGray6, highlightColor: UIColor.systemGray3) | |
/// view.hideSkeleton() | |
extension UIView { | |
public enum SkeletonPosition { | |
case horizontal | |
case vertical | |
case horizontalWithAngle | |
} | |