Swift采集启动数据
1、打开Xcode,依次选择File→New→File(或者⌘N)。

2、在弹出的对话框中选择Swift File,单击Next。

3、将Swift文件命名为main。

4、在AppDelegate.swift文件中注释 @UIApplicationMain ,如下图所示。

5、在main.swift文件中添加如下代码。
import Foundation
import UIKit
NBSAppAgent.start(withAppID: "your_appKey") // 基调听云sdk启动函数
UIApplicationMain(
    CommandLine.argc,
    UnsafeMutableRawPointer(CommandLine.unsafeArgv)
        .bindMemory(
            to: UnsafeMutablePointer<Int8>.self,
            capacity: Int(CommandLine.argc)),
    nil,
    NSStringFromClass(AppDelegate.self)
)