Skip to content

Instantly share code, notes, and snippets.

@Jager-yoo
Created February 3, 2024 01:07
Show Gist options
  • Save Jager-yoo/f2324748c34134ade0b9ad96964e6d97 to your computer and use it in GitHub Desktop.
Save Jager-yoo/f2324748c34134ade0b9ad96964e6d97 to your computer and use it in GitHub Desktop.
forceCharWrapping for watchOS Text
extension String {
/// Forces the string to apply the break by character mode.
///
/// Text("This is a long text.".forceCharWrapping)
var forceCharWrapping: Self {
self.map({ String($0) }).joined(separator: "\u{200B}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment