SSOTPPinView

SSOTPPinView

SSOTPPinView 是一个全面的 iOS 项目库,旨在简化 OTP(一次性密码)输入视图的创建和定制。凭借对自定义键盘、广泛的 OTP 视图定制以及与 SwiftUI 的无缝集成,SSOTPPinView 为安全且用户友好的 OTP 输入提供了一个完整的解决方案。

Swift Version License SwiftPM Compatible Version Platform PRs Welcome

截图

方框样式 圆形样式 下划线样式

特性!

要求

安装

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理工具。您可以使用以下命令安装它

$ gem install cocoapods

导航到项目根文件夹以集成 pod。

$ pod init

它将为您的项目生成 Podfile。要将 SSOTPPinView 集成到您的项目中,请在您的 Podfile 中指定它

platform :ios, '16.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'SSOTPPinView'
end

然后,运行以下命令

$ pod install

它将生成 <Project>.xcworkspace 文件。 从现在开始,您应该使用此文件打开项目。

Swift Package Manager

您可以使用 Swift Package Manager 安装 SSOTPPinView,方法是

  1. 前往 Xcode -> File -> Add Package Dependencies...
  2. 添加软件包 URL https://cocoapods.org.cn/pods/SSOTPPinView
dependencies: [
    .package(url: "https://github.com/SimformSolutionsPvtLtd/SSOTPPinView.git", from: "1.0.1")
]

手动

用法

import SSOTPPinView
SSOTPPinView(textFieldType: .underline, numberOfCount: 5, keyboardOptions: .customRandomDigits) { newValue in
                self.otp = newValue
            }
            .isSecureTextEntry(true)
            .secureTextType(.dot)
            .textColor(.red)
            .fontWeight(.bold)
            .lineColor(.red)
            .lineWidth(2)
            // custom keyboard property
            .keyboardBackgroundColor(.white)
            .keyFontColor(.red)
            .keyStrokeColor(.blue)
    

🤝 如何贡献

无论您是帮助我们修复错误、改进文档还是提出功能请求,我们都非常欢迎您!💪

查看我们的 贡献指南,了解有关贡献的想法。

错误和反馈

对于错误、功能请求和讨论,请使用 GitHub Issues

文档

文档 - 查找完整的 API 参考以获取更详细的文档。

觉得这些示例有用吗? ❤️

通过加入此存储库的 stargazers ⭐ 来支持它。

查看我们的其他库

🗂 Simform Solutions 库→

MIT 许可证

本项目采用 MIT 许可证 - 有关详细信息,请参阅 LICENSE 文件