Commit 55f2fa2f7d41d70226e9a10d4a2f26c94d8e99b0

Authored by 权海
1 parent 1078da2b

feat(ui):升级api imp

@@ -9,6 +9,10 @@ enum ImageProcessError: Error{ @@ -9,6 +9,10 @@ enum ImageProcessError: Error{
9 } 9 }
10 10
11 final class WearEngineHostApiImpl: WearEngineHostApi { 11 final class WearEngineHostApiImpl: WearEngineHostApi {
  12 + func checkConnectedDevice(completion: @escaping (Result<WearDeviceInfo?, any Error>) -> Void) {
  13 + completion(.success(watchService.currentDeviceInfo()))
  14 + }
  15 +
12 func addWatchSurface(completion: @escaping (Result<Bool, any Error>) -> Void) { 16 func addWatchSurface(completion: @escaping (Result<Bool, any Error>) -> Void) {
13 completion(.failure(ImageProcessError.noWatchFound)) 17 completion(.failure(ImageProcessError.noWatchFound))
14 } 18 }
@@ -29,10 +33,6 @@ final class WearEngineHostApiImpl: WearEngineHostApi { @@ -29,10 +33,6 @@ final class WearEngineHostApiImpl: WearEngineHostApi {
29 watchService.hasAvailableDevices() 33 watchService.hasAvailableDevices()
30 } 34 }
31 35
32 - func checkConnectedDevice() throws -> WearDeviceInfo? {  
33 - watchService.currentDeviceInfo()  
34 - }  
35 -  
36 func registerMessageReceiver() throws -> Bool { 36 func registerMessageReceiver() throws -> Bool {
37 watchService.activate() 37 watchService.activate()
38 } 38 }