Skip to content

CleanFlight Serial Demo always selects the 1st device in the combo box. #23

@CartBlanche

Description

@CartBlanche

I believe there is a slight bug on lines 20-21 in the ViewController here...
https://github.com/Arti3DPlayer/USBDeviceSwift/blob/master/CleanFlightSerialExample/CleanFlightSerialExample/ViewController.swift#L20-L21

Instead I think it should be

if (self.devices.count > 0 && self.devicesComboBox.indexOfSelectedItem > -1) {
                let device = self.devices[self.devicesComboBox.indexOfSelectedItem]

I'm new to Swift (and IOKit), so there may be a better way to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions