开关品类控制面板

更新时间:2024-06-24 06:42:26下载pdf

开关品类控制面板 TuyaSmartSwitchPanelKit 是一套基于iOS 9.0及以上版本设备的应用程序接口。开关品类控制面板基于原生代码开发,支持所有开关品类设备的控制面板。

功能优势

  • 轻量级,不含 React Native 等框架。

  • 支持所有开关品类设备,新品提前支持,无需发版。

  • 便于开发阶段调试。

    开关品类控制面板 开关品类控制面板 开关品类控制面板

开启开关品类控制面板

如果您目前接入的 SDK 是 TuyaSmartHomeKit,请按下列步骤进行配置并使用。

  1. 将以下代码加入 Podfile 文件。

    pod 'TuyaSmartSwitchPanelKit'
    
  2. 在您的首页(即设备列表页)加入以下代码:

    Objective-C:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    	[tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    	TuyaSmartDeviceModel *deviceModel = self.home.deviceList[indexPath.row];
    	TuyaSmartSwitchManager *manager = [[TuyaSmartSwitchManager alloc] initWithDeviceId:deviceModel.devId];
    	[self.navigationController pushViewController:manager.viewController animated:YES];
    }