A simple Swift String
extension for converting straight apostrophes and quotes in to typographically correct curly versions.
This package provides a .withSmartQuotes
property on String
, which defaults to English conversions.
For other localizations, a locale can be provided to .withSmartQuotes(locale: Locale?)
. Currently only de
, fi
, and sv
are implemented. Iβm open to contributions for other localizations!
import SmartQuotes
"\"Crime peaked in the '90s\"".withSmartQuotes // βCrime peaked in the β90sβ
"\"Crime peaked in the '90s\"".withSmartQuotes( // βCrime peaked in the β90sβ
Locale(identifier: "de")
)
# Cartfile
github "hallee/swift-smart-quotes" ~> 0.0.1
# Podfile
pod 'SmartQuotes'
dependencies: [
.package(url: "https://github.com/hallee/swift-smart-quotes", from: "0.0.1")
],
targets: [
.target(name: "YourTarget", dependencies: ["SmartQuotes"])
]
link |
Stars: 3 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics