VitaleSDK
描述
VitaleSDK 是用 Swift 编写的全面的智能、自动和自适应训练框架,适用于 iOS 和 iPadOS。它是将我们的物理活动训练功能集成到任何第三方中最便捷的方式。
安装
VitaleSDK 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod 'VitaleSDK'
将以下行添加到 podfile 文件的末尾
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
使用方法
单行简单设置
使用您的MyVitale凭证来启动SDK。您的user_id必须对每个App用户永久唯一(包括您已在系统中使用的任何用户ID,均可使用)。
Training.sharedInstance.start(with: user_id, clientId: client_id, clientSecret: client_secret)
运动资料
Training.sharedInstance.showSportProfile()
智能教练
Training.sharedInstance.showVirtualPT()
自定义配置
您可以通过这些函数来定制不同的PT模块接口。
主色调
可以个性化地设置主SDK颜色。PT模块的所有按钮和主元素都将变为所选颜色。
Training.sharedInstance.setMainColor(color: mainColor)
导航栏背景颜色
自定义PT模块的NavigationBar背景颜色。
Training.sharedInstance.setNavigationBarColor(color: backgroundColor)
导航栏着色颜色
自定义PT模块的NavigationBar着色颜色。
Training.sharedInstance.setNavigationTintColor(color: tintColor)
导航栏标志
将应用程序标志添加到navigationBar。
Training.sharedInstance.setNavigationLogo(color: logo)
作者
MyVitale, [电子邮箱 protected]
许可证
VitaleSDK采用MIT许可。有关更多信息,请参阅LICENSE文件。