首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏ShaoYL

    iOS 蓝牙的GameKit用法

    一、连接蓝牙 显示可以连接的蓝牙设备列表 - (IBAction)buildConnect:(id)sender { // 创建弹窗 GKPeerPickerController *ppc = [[GKPeerPickerController alloc] init]; // 设置代理 @interface ViewController () <GKPeerPickerControllerDelegate ]; } 监听蓝牙的连接 #pragma mark -GKPeerPickerControllerDelegate // 连接成功就会调用 - (void)peerPickerController:(GKPeerPickerController property (nonatomic, strong) GKSession *session; /**< 蓝牙连接会话 */ // 连接成功就会调用 - (void)peerPickerController:(GKPeerPickerController 枚举:发完为止 error:nil]; } 接收 // 连接成功就会调用 - (void)peerPickerController:(GKPeerPickerController

    87850发布于 2018-05-11
领券