将对讲机集成到Swift iOS应用程序中

将对讲机集成到Swift iOS应用程序中,ios,objective-c,swift,intercom,intercom-ios,Ios,Objective C,Swift,Intercom,Intercom Ios,我正在尝试在我正在构建的Swift应用程序中使用。然而,他们的所有文档都是用Objective-C编写的。由于我刚刚开始,我不太确定如何在我的应用程序中实现对讲机 我已经在我的pod文件中添加了“pod‘Intercom’”,并在桥接头中添加了import语句 在iOS应用程序中设置对讲机的下一步是使用以下代码在my applications AppDelegate中初始化对讲机: - (BOOL)application:(UIApplication *)application didFinis

我正在尝试在我正在构建的Swift应用程序中使用。然而,他们的所有文档都是用Objective-C编写的。由于我刚刚开始,我不太确定如何在我的应用程序中实现对讲机

我已经在我的pod文件中添加了“pod‘Intercom’”,并在桥接头中添加了import语句

在iOS应用程序中设置对讲机的下一步是使用以下代码在my applications AppDelegate中初始化对讲机:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize Intercom
[Intercom setApiKey:@"<#ios_sdk-...#>" forAppId:@"<#your-app-id#>"];
}
-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项{
//初始化对讲机
[对讲机设置密钥:@“forAppId:@”];
}
然后在我的swift view控制器中使用objective-c代码,如下所示:

- (void)successfulLogin { 
...
// Registering with Intercom is easy. For best results, use a unique user_id if you have one.
[Intercom registerUserWithUserId:@"<#123456#>"];
}
-(void)成功登录{
...
//注册对讲机很容易。为了获得最佳效果,请使用唯一的用户id(如果有)。
[内部通信注册器UserWithUserId:@”“;
}
我如何在swift项目中实现这样的Objective-c代码

我已经四处搜索,并联系了Intercom的支持人员,但还没有找到答案

非常感谢

[Intercom设置密钥:@“forAppId:@]”;
[Intercom setApiKey:@"<#ios_sdk-...#>" forAppId:@"<#your-app-id#>"];
变成

Intercom.setApiKey("<#ios_sdk-...#>", forAppId:"<#your-app-id#>")
Intercom.registerUserWithUserId("<#123456#>")
Intercom.setApiKey(“,forAppId:”)

[Intercom registerUserWithUserId:@”“];
变成

Intercom.setApiKey("<#ios_sdk-...#>", forAppId:"<#your-app-id#>")
Intercom.registerUserWithUserId("<#123456#>")
Intercom.registerUserWithUserId(“”)
我建议查看Swift教程,了解语法,并学习如何正确地将Objective-C代码迁移到Swift代码