-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewController.swift
68 lines (50 loc) · 1.61 KB
/
ViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// ViewController.swift
// Projector-Clicker
//
// Created by Becca James on 6/9/17.
// Projector by Koen Voogd from the Noun Project
// Copyright © 2017 Becca James. All rights reserved.
//
import UIKit
import Foundation
class ViewController: UIViewController {
//MARK: Properties
var projector : Projector?=nil
override func viewDidLoad() {
super.viewDidLoad()
self.projector = Projector(baseURL: "http://projector.paultag.house")
// Do any additional setup after loading the view, typically from a nib.
}
//MARK: Actions
@IBAction func onSelect(_ sender: UIButton) {
self.projector?.powerOn()
}
@IBAction func offSelect(_ sender: UIButton) {
self.projector?.powerOff()
}
@IBAction func upSelect(_ sender: UIButton) {
self.projector?.volumeUp()
print("volume has been turned up")
}
@IBAction func downSelect(_ sender: UIButton) {
self.projector?.volumeDown()
print("volume has been turned down")
}
@IBAction func muteSelect(_ sender: UIButton) {
self.projector?.muteOn()
}
@IBAction func unmuteSelect(_ sender: UIButton) {
self.projector?.muteOff()
}
@IBAction func freezeSelect(_ sender: UIButton) {
self.projector?.freezeOn()
}
@IBAction func unfreezeSelect(_ sender: UIButton) {
self.projector?.freezeOff()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}