Skip to content

Instantly share code, notes, and snippets.

@dennda
Created Jun 12, 2018
Embed
What would you like to do?
diff --git a/DuolingoMobile/Sources/Explanations/StyledString.swift b/DuolingoMobile/Sources/Explanations/StyledString.swift
index 012e1ff3d..90fc0af5c 100644
--- a/DuolingoMobile/Sources/Explanations/StyledString.swift
+++ b/DuolingoMobile/Sources/Explanations/StyledString.swift
@@ -135,6 +135,16 @@ struct StyledString: Decodable {
attributedString.addAttributes(attributes, range: range)
}
+ if attributedString.string.hasSuffix("manzana") {
+// attributedString.replaceCharacters(in: NSRange(location: 0, length: 9), with: "         ")
+
+ let invisibilityAttributes: [NSAttributedStringKey: Any] = [
+ .foregroundColor: UIColor.clear
+ ]
+ let invisiblePeriod = NSAttributedString(string: ".", attributes: invisibilityAttributes)
+ attributedString.insert(invisiblePeriod, at: 0)
+ }
+
return attributedString.copy() as! NSAttributedString
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment