let attrs = [
NSForegroundColorAttributeName : UIColor.init(hexString: "#FF9500"),
NSTextAlignment: NSTextAlignment.right
] as [String : Any]
viewString.append(
NSMutableAttributedString(
string: symbol,
attributes: attrs1
)
)
let string = "Any String"
let style = NSMutableParagraphStyle()
style.alignment = .right
let attributes = [
NSForegroundColorAttributeName: UIColor.white,
NSParagraphStyleAttributeName: style
]
let attributedString = NSMutableAttributedString(string: string, attributes: attributes)
textView.attributedText = attributedString