TranslateView

1.0.1

Call iOS system translate in you SwiftUI
HDCodePractice/TranslateView

What's New

v1.0.1

2022-01-27T02:51:43Z

Fix the problem that the translation window cannot be called out again for the same content

ios

TranslateView

A SwiftUI view that enables you to properly present a iOS 15 TranslateViewController.

TranslateViewInPad

TranslateViewInPhone

Example

@State private var text: String?

var body: some View {
    Button {
        text = "Hello World"
    } label: {
        Text("translate")
    }
    .translateSheet($item)
}

Installation

The code is packaged as a framework. You can install manually (by copying the files in the Sources directory) or using Swift Package Manager (preferred)

To install using Swift Package Manager, add this to the dependencies section of your Package.swift file:

.package(url: "https://github.com/HDCodePractice/TranslateView.git", .upToNextMinor(from: "1.0.0"))

Note: The package requires iOS v15+

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Nov 06 2024 06:28:07 GMT-1000 (Hawaii-Aleutian Standard Time)