Created
February 3, 2024 01:07
-
-
Save Jager-yoo/f2324748c34134ade0b9ad96964e6d97 to your computer and use it in GitHub Desktop.
forceCharWrapping for watchOS Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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