Latest 0.2
Homepage https://github.com/ungacy/YCPinYin
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Installation with CocoaPods

YCEasyTool is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "YCPinYin"

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate YCPinYin into your Xcode project using Carthage, specify it in your Cartfile:

github "ungacy/YCPinYin"

Run carthage to build the frameworks and drag the appropriate framework (YCPinYin.framework) into your Xcode project according to your need. Make sure to add only one framework and not both.

Usage

首字母

设置输出格式,初始化一次就好.

[YCPinYin sharedInstance].defaultFormat = YCPinYinOutoutFormatFirstLetter;

用吧

NSString *string = @"你好";
NSString *pinyin = [string yc_toPinYin];//nh
NSParameterAssert([pinyin isEqualToString:@"nh"]);

全部字母

设置输出格式,初始化一次就好.

[YCPinYin sharedInstance].defaultFormat = YCPinYinOutoutFormatAllLetter;

用吧

NSString *string = @"你好";
NSString *pinyin = [string yc_toPinYin];//nihao
NSParameterAssert([pinyin isEqualToString:@"nihao"]);

首字母+全部字母

设置输出格式,初始化一次就好.

[YCPinYin sharedInstance].defaultFormat = YCPinYinOutoutFormatDefault;

or

[YCPinYin sharedInstance].defaultFormat = YCPinYinOutoutFormatAllLetter | YCPinYinOutoutFormatFirstLetter;

用吧

NSString *string = @"你好";
NSString *pinyin = [string yc_toPinYin];//nh#nihao
NSParameterAssert([pinyin isEqualToString:@"nh#nihao"]);

声调

感觉用处不多,见demo

更多

见demo

Author

ungacy, [email protected]

License

YCPinYin is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "YCPinYin",
    "version": "0.2",
    "summary": "PinYin of chinese inspired by PinYin4Objc.",
    "description": "PinYin of chinese inspired by PinYin4Objc.n`u5355u8d1d` => `db#cb#sb#danbei#chanbei#shanbei` or `db#cb#sb` or `danbei#chanbei#shanbei`",
    "homepage": "https://github.com/ungacy/YCPinYin",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ungacy": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ungacy/YCPinYin.git",
        "tag": "0.2"
    },
    "social_media_url": "https://twitter.com/ungacy",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YCPinYin/Classes/**/*",
    "resources": [
        "YCPinYin/Assets/*.plist"
    ],
    "public_header_files": "YCPinYin/Classes/**/*.h"
}

Pin It on Pinterest

Share This