Simplify UI, update domain

This commit is contained in:
Christoph Hagen
2020-09-20 13:28:22 +02:00
parent f1a36d5cbe
commit 75ebdf59ae
9 changed files with 211 additions and 221 deletions

View File

@@ -24,8 +24,6 @@ class CameraController: UIViewController {
@IBOutlet weak var cropView: CropView!
@IBOutlet weak var cancelButton: UIButton!
@IBOutlet weak var bottomBar: UIView!
@IBOutlet weak var cameraView: CameraView! {
didSet {
@@ -67,9 +65,7 @@ class CameraController: UIViewController {
super.viewWillAppear(animated)
cameraView.delegate = self
imageButton.imageView?.image = UIImage.templateImage(named: "camera")
setTintColor()
cameraView.launch { success, error in
guard let err = error else {
return
@@ -88,27 +84,6 @@ class CameraController: UIViewController {
cameraView.complete()
}
private func setTintColor() {
let blur = UIBlurEffect(style: .systemThinMaterial)
let a = UIVisualEffectView(effect: blur)
a.translatesAutoresizingMaskIntoConstraints = false
bottomBar.backgroundColor = nil
bottomBar.insertSubview(a, at: 0)
//bottomBar.addSubview(a)
let t = bottomBar.topAnchor.constraint(equalTo: a.topAnchor)
let b = bottomBar.bottomAnchor.constraint(equalTo: a.bottomAnchor)
let l = bottomBar.leadingAnchor.constraint(equalTo: a.leadingAnchor)
let r = bottomBar.trailingAnchor.constraint(equalTo: a.trailingAnchor)
bottomBar.addConstraints([t,b,l,r])
//let tint = AppDelegate.tintColor
//cropView.lineColor = tint
//imageButton.borderColor = tint
imageButton.imageView?.tintColor = .systemBlue
//cancelButton.borderColor = tint
//cancelButton.set(template: "cancel", with: tint)
}
private func giveFeedback(_ style: UIImpactFeedbackGenerator.FeedbackStyle) {
let generator = UIImpactFeedbackGenerator(style: style)
generator.impactOccurred()