Skip to content

Instantly share code, notes, and snippets.

@dennda
Created June 12, 2018 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennda/3f9b31f873b20677b70c499f083f1be2 to your computer and use it in GitHub Desktop.
Save dennda/3f9b31f873b20677b70c499f083f1be2 to your computer and use it in GitHub Desktop.
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