Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let a_attrib: [NSAttributedString.Key : Any] = [NSAttributedString.Key.foregroundColor: UIColor.purple, NSAttributedString.Key.writingDirection: NSWritingDirection.rightToLeft];
- let a_attrib: [NSAttributedString.Key : Any] = [NSAttributedString.Key.foregroundColor: UIColor.purple];
- self.myTextArea.makeTextWritingDirectionRightToLeft(self);
- func getMeaning() {
- do {
- let combination = NSMutableAttributedString();
- let q = try db.prepare("select word, meaning from Mani where SID=(self.SID) and IsFarsi=true");
- for x in q {
- let a_attrib: [NSAttributedString.Key : Any] = [NSAttributedString.Key.foregroundColor: UIColor.purple];
- let b_attrib: [NSAttributedString.Key : Any] = [NSAttributedString.Key.foregroundColor: UIColor.black];
- let a = (x[0]! as? String)! + "n";
- let b = (x[1]! as? String)! + "nn";
- let aa = NSAttributedString(string: a, attributes: a_attrib);
- let bb = NSAttributedString(string: b, attributes: b_attrib);
- combination.append(aa);
- combination.append(bb);
- }
- self.myTextArea.attributedText = combination;
- } catch {
- print(error);
- }
- }
Add Comment
Please, Sign In to add comment