-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
308 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.8 KB
(140%)
BoostRemote/Assets.xcassets/connected.imageset/connected.pdf
Binary file not shown.
Binary file modified
BIN
+2.29 KB
(150%)
BoostRemote/Assets.xcassets/connecting1.imageset/connecting1.pdf
Binary file not shown.
Binary file modified
BIN
+2.29 KB
(150%)
BoostRemote/Assets.xcassets/connecting2.imageset/connecting2.pdf
Binary file not shown.
Binary file modified
BIN
+2.29 KB
(150%)
BoostRemote/Assets.xcassets/connecting3.imageset/connecting3.pdf
Binary file not shown.
Binary file modified
BIN
+2.28 KB
(150%)
BoostRemote/Assets.xcassets/connecting4.imageset/connecting4.pdf
Binary file not shown.
Binary file modified
BIN
+2.29 KB
(150%)
BoostRemote/Assets.xcassets/disconnected.imageset/disconnected.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "portA.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "portB.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "portC.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "portD.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// StickView.swift | ||
// BoostRemote | ||
// | ||
// Created by ooba on 09/10/2017. | ||
// Copyright © 2017 bricklife.com. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@IBDesignable | ||
class StickView: UIView { | ||
|
||
var slider: UISlider { | ||
return verticalSlider.slider | ||
} | ||
|
||
var port: Port? { | ||
didSet { | ||
imageView.image = port.flatMap { UIImage(named: "port\($0)") } | ||
} | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
|
||
initialize() | ||
} | ||
|
||
required override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
initialize() | ||
} | ||
|
||
private func initialize() { | ||
addSubview(verticalSlider) | ||
addSubview(imageView) | ||
|
||
NSLayoutConstraint.activate([ | ||
verticalSlider.topAnchor.constraint(equalTo: topAnchor), | ||
verticalSlider.leftAnchor.constraint(equalTo: leftAnchor), | ||
verticalSlider.rightAnchor.constraint(equalTo: rightAnchor), | ||
]) | ||
|
||
NSLayoutConstraint.activate([ | ||
imageView.topAnchor.constraint(equalTo: verticalSlider.bottomAnchor, constant: 16), | ||
imageView.bottomAnchor.constraint(equalTo: bottomAnchor), | ||
imageView.centerXAnchor.constraint(equalTo: centerXAnchor), | ||
imageView.heightAnchor.constraint(equalToConstant: 32), | ||
]) | ||
} | ||
|
||
private let verticalSlider: VerticalSlider = { | ||
let verticalSlider = VerticalSlider() | ||
verticalSlider.translatesAutoresizingMaskIntoConstraints = false | ||
|
||
verticalSlider.slider.setThumbImage(UIImage(named: "thumb"), for: .normal) | ||
verticalSlider.slider.setMinimumTrackImage(UIImage(named: "left"), for: .normal) | ||
verticalSlider.slider.setMaximumTrackImage(UIImage(named: "right"), for: .normal) | ||
|
||
verticalSlider.slider.maximumValue = 10 | ||
verticalSlider.slider.minimumValue = -10 | ||
verticalSlider.slider.value = 0 | ||
|
||
return verticalSlider | ||
}() | ||
|
||
private let imageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.translatesAutoresizingMaskIntoConstraints = false | ||
|
||
imageView.contentMode = .center | ||
return imageView | ||
}() | ||
} |
Oops, something went wrong.