Skip to content

Commit e17c57f

Browse files
alrikaiAnka
andauthored
Release 2.0.1 (#13)
Co-authored-by: Anka <[email protected]>
1 parent 3496168 commit e17c57f

File tree

9 files changed

+32
-31
lines changed

9 files changed

+32
-31
lines changed

Package.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,33 @@ let package = Package(
3232

3333
.binaryTarget(
3434
name: "ObjcExceptionBridging",
35-
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/203311933.zip",
36-
checksum: "5fa8986aa63f860c681eefece027e919ccdf02e80f4da4a66e701a561cad4e73"
35+
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/205762128.zip",
36+
checksum: "9291aff529fbfd935c37581f49cc8a2365b6aa144e1aa60dc4b9ecc42e217c3f"
3737
),
3838
.binaryTarget(
3939
name: "_HoverSDK",
40-
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/203311994.zip",
41-
checksum: "c4ae23a5ebb048c40b346f41d5757ba24b50980f017b8a1ff27f35902ef4ef40"
40+
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/205762141.zip",
41+
checksum: "ec11f0b3aaed3991d8d9d4224d271fba16e3c0edb8edf99094d49c69b222c128"
4242
),
4343
.binaryTarget(
4444
name: "_HVAVCamera",
45-
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/203311934.zip",
46-
checksum: "2355881d8b1b50a0cec6d7480f3a10db5994abaef5bca0a4c6a52bc56b586660"
45+
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/205762129.zip",
46+
checksum: "d463a2cfccc8ca1f6dd41def241aa834657d2e2730f104a00439d4e7004db683"
4747
),
4848
.binaryTarget(
4949
name: "_HVCore",
50-
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/203311990.zip",
51-
checksum: "44152baf504ab9872a357f298ef3e38f0c482de19d11a0effcfcf9f11ca96093"
50+
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/205762139.zip",
51+
checksum: "65f8e171057a1376a07b9a3dd9a83aacff7842d14484c3f1ac0bb7f532ba7c3a"
5252
),
5353
.binaryTarget(
5454
name: "_HVCVPixelBufferHelper",
55-
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/203311987.zip",
56-
checksum: "838cfb39bbd2bdc66e5298e1dfa6b624fb7275ce1d7c5fc94bb717cf35efab1b"
55+
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/205762130.zip",
56+
checksum: "52450bd150674d69d90acdc375777b765262c86ff546d80672fda1bb78764b62"
5757
),
5858
.binaryTarget(
5959
name: "_XCGLogger",
60-
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/203311996.zip",
61-
checksum: "2b774d6d83aa1ee5205fd169a22d5fd6e5340b050e06c52227a503b3298e1a5f"
60+
url: "https://api.github.com/repos/hoverinc/hover-capture-ios/releases/assets/205762148.zip",
61+
checksum: "5c7560658e11b11708b11144b507deb219d33f4dd97703a8429318fa1fd45d01"
6262
),
6363
]
6464
)

Sources/HVCaptureSDK/HVCaptureSDK.docc/GettingStarted.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The SDK should be initialized as early as possible in the app lifecycle. This is
2525
As such, the SDK should (ideally) be initialized in host application’s `applicationDidFinishLaunching` method, so that the SDK can continue uploading any files that remain to be uploaded. This helps expedite 3D model generation, as we need all the captured images and metadata to begin the 3D reconstruction process.
2626

2727
```swift
28-
import HVPartnerSDK
28+
import HVCaptureSDK
2929
class AppDelegate: UIResponder, UIApplicationDelegate {
3030
// ...
3131

@@ -36,7 +36,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3636
}
3737
```
3838

39-
While running this in `applicationDidFinishLaunching` would be ideal, at a minimum it should be run at some point prior to starting a capture session.
39+
While running this in `applicationDidFinishLaunching` would be ideal, at a minimum it should be run at some point prior to starting a capture session.
4040

4141
NOTE: if background uploads are both enabled and wanted, the application should call `HVPartnerSDK.sharedInstance.registerForBackgroundJobs()` before the app completes launching. See the section on [Supporting Background Uploads](#supporting-background-uploads) for further details.
4242

@@ -107,15 +107,15 @@ DispatchQueue.main.asyncAfter(deadline: .now() + 10, execute: {
107107

108108
Since the capture flow proceeds asynchronously, the host app may want to monitor the local job status as the capture proceeds. There are a few methods for obtaining Job status:
109109

110-
1. on-demand: The ``HVPartnerSDK`` class exposes a public method ``HVPartnerSDK/getClientJobStatus(for:)``. This is an `async` method that will return what the requested `Job`'s current status as a ``JobStatus``. If the requested ``Job`` doesn't exist locally, then it will raise a ``HVJobError`` exception.
110+
1. on-demand: The ``HVPartnerSDK`` class exposes a public method ``HVPartnerSDK/getClientJobStatus(for:)``. This is an `async` method that will return what the requested `Job`'s current status as a ``JobStatus``. If the requested ``Job`` doesn't exist locally, then it will raise a ``HVJobError`` exception.
111111
2. streaming: The ``HVPartnerSDK`` class also exposes a public method ``HVPartnerSDK/getJobStateObservable(for:)`` that returns a `Combine` publisher for the requested `Job`. The publisher will emit ``JobStatus`` instances whenever there's a change in the `Job`'s status. Additionally, `startCaptureSession` will return what the current `Job`'s status is when called, so together with `getJobStateObservable` you can track the whole status history for the `Job` (n.b. the initial state won't be published for a `Job`, so to get the complete status history you need to use the initial state returned from ``HVPartnerSDK/startCaptureSession(settings:info:)`` in conjunction with the publisher from `getJobStateObservable`). The initial Job state will generally be ``JobStatus.Created`` if newly created, or ``JobStatus.Draft`` if resuming an existing Job.
112112

113113
For example, adapting the previous example to monitor the `Job` status and build a complete `JobStatus` history for the capture session, you can do:
114114

115115
```swift
116-
import HVCaptureSDK
117-
import SwiftUI
118116
import Combine
117+
import SwiftUI
118+
import HVCaptureSDK
119119

120120
struct FooView: View {
121121
let jobInfo: CaptureJobInformation
@@ -137,14 +137,14 @@ struct FooView: View {
137137
if jobCancellables[jobInfo.identifier] == nil {
138138
let cancellable = HVPartnerSDK.sharedInstance.getJobStateObservable(for: jobInfo.identifier).sink(receiveValue: { (jobState: JobStatus) in
139139
// NOTE: you can take various actions here based on the status change
140-
if case let .UploadProgress(_, uploadStatus) = jobState {
140+
if case let .uploadProgress(_, uploadStatus) = jobState {
141141
print("Job@State: \(jobState) --> File@State: \(String(describing: uploadStatus))")
142-
} else if case let .Error(_, error) = jobState {
142+
} else if case let .error(_, error) = jobState {
143143
print("Job@State: \(jobState) --> Error: \(error)")
144144
} else {
145145
print("Job@State: \(jobState)")
146146
}
147-
jobStatusHistory[jobInfo.identifier]?.append(jobStatus)
147+
jobStatusHistory[jobInfo.identifier]?.append(jobState)
148148
})
149149
jobCancellables[jobInfo.identifier] = cancellable
150150
}
@@ -192,4 +192,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
192192

193193
> Warning: Since we use `BGTaskScheduler` for our background processing, we need to call ``HVPartnerSDK/registerForBackgroundJobs()`` **before** the application finishes launching. If not, then the application will raise an `NSInternalInconsistencyException` exception with the reason: `'All launch handlers must be registered before application finishes launching'`. This is a constraint imposed by the [BGTaskScheduler framework itself](https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler/register(fortaskwithidentifier:using:launchhandler:)#Discussion) and if ignored will likely crash the application.
194194

195-
While using `registerForBackgroundJobs` enables the SDK to schedule background tasks on its own as needed, it's also possible to disable automatic background task scheduling and have more manual control over background task scheduling. This can be useful for applications that want closer control over background tasks spawned from the SDK and which already have their own background task scheduling. This can be achieved by **not** calling ``HVPartnerSDK/registerForBackgroundJobs()``, and instead calling ``HVPartnerSDK/initializeForBackground(parameters:)`` from within a [BGProcessingTask](https://developer.apple.com/documentation/backgroundtasks/bgprocessingtask). Under the hood, this will check if there are pending uploads. If there are no pending uploads, then it will exit and do nothing. If there are, then it'll run asynchronously and attempt to complete the pending uploads, performing a single upload at a time and exiting once the pending upload queue has been completed.
195+
While using `registerForBackgroundJobs` enables the SDK to schedule background tasks on its own as needed, it's also possible to disable automatic background task scheduling and have more manual control over background task scheduling. This can be useful for applications that want closer control over background tasks spawned from the SDK and which already have their own background task scheduling. This can be achieved by **not** calling ``HVPartnerSDK/registerForBackgroundJobs()``, and instead calling ``HVPartnerSDK/initializeForBackground(parameters:)`` from within a [BGProcessingTask](https://developer.apple.com/documentation/backgroundtasks/bgprocessingtask). Under the hood, this will check if there are pending uploads. If there are no pending uploads, then it will exit and do nothing. If there are, then it'll run asynchronously and attempt to complete the pending uploads, performing a single upload at a time and exiting once the pending upload queue has been completed.

Sources/HVCaptureSDK/HVCaptureSDK.docc/Resources/code-files/tutorial-sdk-code-06.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import SwiftUI
1+
import Combine
22
import HVCaptureSDK
3+
import SwiftUI
34

45
struct ContentView: View {
56

@@ -34,14 +35,14 @@ struct ContentView: View {
3435
// check if we have a listener for the job already, so we don't make duplicate listeners each time the view is created
3536
if jobCancellables[jobInfo.identifier] == nil {
3637
let cancellable = HVPartnerSDK.sharedInstance.getJobStateObservable(for: jobInfo.identifier).sink(receiveValue: { (jobState: JobStatus) in
37-
if case let .UploadProgress(_, uploadStatus) = jobState {
38+
if case let .uploadProgress(_, uploadStatus) = jobState {
3839
print("Job@State: \(jobState) --> File@State: \(String(describing: uploadStatus))")
39-
} else if case let .Error(_, error) = jobState {
40+
} else if case let .error(_, error) = jobState {
4041
print("Job@State: \(jobState) --> Error: \(error.localizedDescription)")
4142
} else {
4243
print("Job@State: \(jobState)")
4344
}
44-
jobStateHistory[jobInfo.identifier]?.append(jobStatus)
45+
jobStateHistory[jobInfo.identifier]?.append(jobState)
4546
})
4647
jobCancellables[jobInfo.identifier] = cancellable
4748
}
@@ -50,15 +51,15 @@ struct ContentView: View {
5051
} catch let error as HVSessionError {
5152
// maybe handle our known errors here
5253
switch error.kind {
53-
case .UserCancelled:
54+
case .userCancelled:
5455
print("User cancelled capture flow")
55-
case .FilesystemUnavailable:
56+
case .filesystemUnavailable:
5657
print("File system is not writable?")
57-
case .SessionCreationFailed:
58+
case .sessionCreationFailed:
5859
print("Could not create capture session")
59-
case .ViewControllerMissing:
60+
case .viewControllerMissing:
6061
print("View Controller absent")
61-
case .Unknown(let errorMsg):
62+
case .unknown(let errorMsg):
6263
print("unknown error \(errorMsg)")
6364
@unknown default:
6465
fatalError("Unknown error")
1.8 MB
Loading
88.7 KB
Loading
-137 Bytes
Loading
21.6 KB
Loading
-108 KB
Loading

Sources/HVCaptureSDK/HVCaptureSDK.docc/Tutorials/HVThemeCustomization.tutorial

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
@Step {
6767
In this step, we specify some of the customizable icons.
6868
The icon for the success screen is specified with ``HVTheme/hoverCaptureSuccessIcon``, set to `Image(systemName: "paperplane")` in this step. It's color is determined by the `hoverCaptureTutorialImageOverlayStroke` setting.
69-
Applications can use arbitrary custom images by supplying them in the application bundle, downloading them from the internet at runtime, etc. We simply used system images here for simplicity's sake.
69+
Applications can use arbitrary custom images by supplying them in the application bundle, downloading them from the internet at runtime, etc. We simply used system images here for simplicity's sake. Note however that we set the icon theme based on the theme, so `Image`s are rendered with [Image.renderingMode](https://developer.apple.com/documentation/swiftui/image/renderingmode(_:)) set to `.template`, so the original icon's color will be overridden by the corresponding theme color.
7070

7171
@Code(name: "ContentView.swift", file: tutorial-hvtheme-code-06) {
7272
@Image(source: t2-s3-icons, alt: "Screens with configured icons")

0 commit comments

Comments
 (0)