Hexagon Data iOS CocoaPods
示例
要运行示例项目,请克隆该仓库,然后首先从 Example 目录运行 pod install
要求
安装
hexagonmatch-pods 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中即可
pod 'hexagonmatch-pods'
导入库
import hexagonmatch_pods
创建实例
Hexagon Data Cocoapods实例可以在需要的位置创建。
let hmmanager = hexagonmatchpods(platformId: "1", tagId: "4001", clientId: "LAX")
hexagonmatch-sdk对象接受以下参数
- Hexagon Match平台由Hexagon Data提供的客户端ID
- String tagId - 由Hexagon Data提供。
- String Platform - 由Hexagon Data提供
传递值
hmmanager.SendData(keyValue: "[email protected]", keyType: "email")
完整示例
import SwiftUI
import hexagonmatch_pods
struct ContentView: View {
@State private var message = "Escribe tu correo"
@State private var textStyle = UIFont.TextStyle.body
var hm = hexagonmatchpods(platformId: "2", tagId: "7989", clientId: "amex")
var body: some View {
ZStack(alignment: .topTrailing) {
TextView(text: $message, textStyle: $textStyle)
.padding(.horizontal)
Button(action: {
hm.SendData(keyValue:"235kiet", keyType: "customer")
self.textStyle = (self.textStyle == .body) ? .title1 : .body
}) {
Image(systemName: "textformat")
.imageScale(.large)
.frame(width: 80, height: 60)
.foregroundColor(.white)
.background(Color.purple)
}
.padding()
}
}
}
请在您认为是正确的地方调用函数。
Objective C
您可以在Objective C中使用@导入库
@import hexagonmatch_pods;
作者
Hexagon Data, [email protected]
许可
Hexagon Data iOS CocoaPods 在MIT许可证下可用。有关更多信息,请参见LICENSE文件。