Skip to content

William-Weng/WWStringTransform

Repository files navigation

WWStringTransform

Swift-5.6 iOS-14.0 Swift Package Manager-SUCCESS LICENSE

WWStringTransform

dependencies: [
    .package(url: "https://github.com/William-Weng/WWStringTransform.git", .upToNextMajor(from: "1.0.0"))
]

可用函式

函式 說明
convertText(_:type:reverse:) 文字轉換

Example

import UIKit
import WWStringTransform

final class ViewController: UIViewController {
    
    @IBOutlet weak var messageLabel: UILabel!
    @IBOutlet weak var resultLabel: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func hantHansConverter(_ sender: UIButton) {
        resultLabel.text = WWStringTransform.shared.convertText(messageLabel.text, type: .hantHans)
    }
    
    @IBAction func bopomofoConverter(_ sender: UIButton) {
        resultLabel.text = WWStringTransform.shared.convertText(messageLabel.text, type: .bopomofo)
    }
    
    @IBAction func englishConverter(_ sender: UIButton) {
        resultLabel.text = WWStringTransform.shared.convertText(messageLabel.text, type: .english)
    }

    @IBAction func latinConverter(_ sender: UIButton) {
        resultLabel.text = WWStringTransform.shared.convertText(messageLabel.text, type: .latin)
    }

    @IBAction func pinyinConverter(_ sender: UIButton) {
        resultLabel.text = WWStringTransform.shared.convertText(messageLabel.text, type: .pinyin)
    }
}

About

String transform - latin / english / pinyin / bopomofo / hansHant / hantHans.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages