Swiftpack.co - hallee/swift-smart-quotes as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by hallee.
hallee/swift-smart-quotes 0.0.1
πŸ—ž Swift String extension for typographically correct quotes & apostrophes
⭐️ 3
πŸ•“ 4 years ago
.package(url: "https://github.com/hallee/swift-smart-quotes.git", from: "0.0.1")

SmartQuotes

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")
)

Installation

Carthage

# Cartfile
github "hallee/swift-smart-quotes" ~> 0.0.1

CocoaPods

# Podfile
pod 'SmartQuotes'

SwiftPM

dependencies: [
    .package(url: "https://github.com/hallee/swift-smart-quotes", from: "0.0.1")
],
targets: [
    .target(name: "YourTarget", dependencies: ["SmartQuotes"])
]

TODO

  • ☐ Localizations

GitHub

link
Stars: 3
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics