USBDeviceSwift - 是一个用纯 Swift 编写的 IOKit.usb
、IOKit.hid
和 IOKit.serial
封装库,它允许你方便地使用 USB 设备。
![]() |
![]() |
---|---|
![]() |
在 Swift 中使用 IOKit.usb
、IOKit.hid
和 IOKit.serial
是件痛苦的事情。大量的未转换的 C 代码和指针使你的工作更加困难。该库提供了基本的连接/断开连接事件,转换后的发送和接收请求的函数以及示例。
CocoaPods 是一个 Cocoa 项目的依赖管理工具。
在你的项目的 Podfile
中指定 USBDeviceSwift
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'testusb' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for testusb
pod 'USBDeviceSwift'
end
然后运行以下命令
$ pod install
import PackageDescription
let package = Package(
name: "Example project",
dependencies: [
.Package(url: "https://github.com/Arti3DPlayer/USBDeviceSwift.git", majorVersion: 1),
]
)
你可以在 Wiki 页面这里找到所有示例
该项目基于 MIT 许可证 - 详细信息请参阅 LICENSE.md 文件
可以在 CHANGELOG.md 文件中找到。