mirror of
https://github.com/tappollo/OSCKit.git
synced 2026-04-28 18:25:23 +08:00
Fix v2 issue
This commit is contained in:
@@ -23,18 +23,23 @@ class ViewController: UIViewController {
|
||||
// print(try await(OSCKit.shared.usingVersion2_1()))
|
||||
// }
|
||||
self.ssidLabel.text = self.sdk.currentSSID
|
||||
async {
|
||||
do {
|
||||
try await(self.sdk.waitForInitialization())
|
||||
} catch(let error) {
|
||||
print(error)
|
||||
}
|
||||
self.sdk.startLivePreview { (image) in
|
||||
DispatchQueue.main.async {
|
||||
self.image.image = image
|
||||
}
|
||||
}
|
||||
}
|
||||
// async {
|
||||
// do {
|
||||
// try await(self.sdk.waitForInitialization())
|
||||
// } catch(let error) {
|
||||
// print(error)
|
||||
// }
|
||||
// self.sdk.startLivePreview { (image) in
|
||||
// DispatchQueue.main.async {
|
||||
// self.image.image = image
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
self.sdk.takePicture().then(execute: {
|
||||
self.sdk.getImage(url: $0)
|
||||
}).then(on: .main) { (image: UIImage) -> Void in
|
||||
self.image.image = image
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user