Skip to content

Commit

Permalink
Merge pull request #72 from gerriet/button-visibility
Browse files Browse the repository at this point in the history
Allow setting button visibility
  • Loading branch information
dokun1 authored Mar 29, 2018
2 parents bcae81b + a982f7e commit 0ae0235
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Lumina/Lumina/UI/LuminaViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,23 @@ public final class LuminaViewController: UIViewController {
}
}

/// Setting visibility of the buttons (default: all buttons are visible)
public func setCancelButton(visible: Bool) {
cancelButton.isHidden = !visible
}

public func setShutterButton(visible: Bool) {
shutterButton.isHidden = !visible
}

public func setSwitchButton(visible: Bool) {
switchButton.isHidden = !visible
}

public func setTorchButton(visible: Bool) {
torchButton.isHidden = !visible
}

/// A collection of model types that will be used when streaming images for object recognition
///
/// - Note: Only works on iOS 11 and up
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,19 @@ func streamed(videoFrame: UIImage, with predictions: [LuminaRecognitionResult]?,

Note that this returns a class type representation associated with the detected results. The example above also makes use of the built-in text prompt mechanism for Lumina.

### Changing the user interface

To adapt the user interface to your needs, you can set the visibility of the buttons by calling these methods on `LuminaViewController`:

```swift
camera.setCancelButton(visible: Bool)
camera.setShutterButton(visible: Bool)
camera.setSwitchButton(visible: Bool)
camera.setTorchButton(visible: Bool)
```

Per default, all of the buttons are visible.

## Maintainers

- David Okun [![Twitter Follow](https://img.shields.io/twitter/follow/dokun24.svg?style=social&label=Follow)](https://twitter.com/dokun24) [![GitHub followers](https://img.shields.io/github/followers/dokun1.svg?style=social&label=Follow)](https://github.com/dokun1)
Expand Down

0 comments on commit 0ae0235

Please sign in to comment.