【发布时间】:2018-03-15 11:19:18
【问题描述】:
我想读取一个配件的信息,输入HMAccessory,例如序列号(HMCharacteristicTypeSerialNumber),制造商(HMCharacteristicTypeManufacturer),型号(HMCharacteristicTypeModel),但它们都在iOS11中被弃用,根据这个苹果文档here。
我知道我可以直接使用characteristicType 字符串,如下所示:
HMCharacteristicTypeSerialNumber -> 00000030-0000-1000-8000-0026BB765291
HMCharacteristicTypeManufacturer -> 00000020-0000-1000-8000-0026BB765291
HMCharacteristicTypeModel-> 00000021-0000-1000-8000-0026BB765291
但这只会让我的代码“非常规”、丑陋。
您知道序列号、制造商和型号的特征类型的替换吗?我已经搜索了几个小时,但仍然没有任何线索。
【问题讨论】:
-
我对这些被弃用的假设不仅是 Characteristic -> UUID 映射将在未来消失,而且要求这些 UUID 将不再返回有效结果。很遗憾,我还没有任何答案。
标签: swift deprecated ios11 swift4 homekit