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!
Usage
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")
)
SmartQuotes
A simple Swift
String
extension for converting straight apostrophes and quotes in to typographically correct curly versions.This package provides a
.withSmartQuotes
property onString
, which defaults to English conversions.For other localizations, a locale can be provided to
.withSmartQuotes(locale: Locale?)
. Currently onlyde
,fi
, andsv
are implemented. I’m open to contributions for other localizations!Usage
Installation
Carthage
CocoaPods
SwiftPM
TODO