| 1 |
// |
|
| 2 |
// ControlView.swift |
|
| 3 |
// USB Meter |
|
| 4 |
// |
|
| 5 |
// Created by Bogdan Timofte on 09/03/2020. |
|
| 6 |
// Copyright © 2020 Bogdan Timofte. All rights reserved. |
|
| 7 |
// |
|
| 8 | ||
| 9 |
import SwiftUI |
|
| 10 | ||
| 11 |
struct ControlView: View {
|
|
| 12 | ||
| 13 |
@EnvironmentObject private var meter: Meter |
|
| 14 | ||
| 15 |
var body: some View {
|
|
| 16 |
HStack {
|
|
| 17 |
VStack {
|
|
| 18 |
HStack {
|
|
| 19 |
Button(action: { self.meter.rotateScreen() }, label: { Image(systemName: "arrow.clockwise") })
|
|
| 20 |
} |
|
| 21 |
HStack {
|
|
| 22 |
Button(action: { self.meter.previousScreen() }, label: { Image(systemName: "arrowtriangle.left") })
|
|
| 23 |
Text(meter.currentScreenDescription) |
|
| 24 |
Button(action: { self.meter.nextScreen() }, label: { Image(systemName: "arrowtriangle.right") })
|
|
| 25 |
} |
|
| 26 |
} |
|
| 27 |
} |
|
| 28 |
} |
|
| 29 |
} |
|
| 30 | ||
| 31 |
struct ControlView_Previews: PreviewProvider {
|
|
| 32 |
static var previews: some View {
|
|
| 33 |
ControlView() |
|
| 34 |
} |
|
| 35 |
} |