Skip to content

UnconfiguredExternalAccessory has no configure function #12

@jangelsb

Description

@jangelsb

Hello,

First of all, thank you for this great framework. I am trying to configure a UnconfiguredExternalAccessory and the documentation says to

// device is an UnconfiguredExternalAccessory gotten from Discovery
device
    .configure(on: viewController)
    .sink(receiveCompletion: { completion
        // Configuration has finished, either successfully or with an error
        switch completion {
        case .finished:
            // All good, user finished setting up this device
        case .failure(let error):
            switch error {
            case .cancelled:
                // User cancelled the flow
            case .failed:
                // Something failed during the process
            }
        }
    }, ...)

but there is no .configure(on:) function on UnconfiguredExternalAccessory and I can't find any reference to it in the code base.

I did see there is a UnconfiguredExternalAccessoryPublisher that takes a view controller. Are we supposed to use that?

Something like this?

UnconfiguredExternalAccessoryPublisher(browser: browser, unconfiguredExternalAccessory: device, viewController: visibleViewController)
.sink { completion in
    switch completion {
        case .finished:
            // All good, user finished setting up this device
            break
        case .failure(let error):
            switch error {
                case .cancelled:
                    // User cancelled the flow
                    break

                case .failed:
                    // Something failed during the process
                    break
            }
    }
    
} receiveValue: { _ in
    // never
}
.store(in: &subscriptions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions