目录
目录README.md

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
关于
55.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号