Remove dead code

This commit is contained in:
Christoph Hagen 2019-04-12 13:46:29 +02:00
parent 02e8e9a585
commit 8ee1ed8ebf

View File

@ -10,8 +10,6 @@ import UIKit
class GridViewController: UIViewController {
private let columns = 40
static let len: CGFloat = 60
@ -53,31 +51,6 @@ class GridViewController: UIViewController {
scrollView.zoomScale = 0.5
scrollView.maximumZoomScale = 1
setZoomRange()
/*
guard let image = Cap.mosaic else {
error("No mosaic")
return
}
imageView.image = image
imageHeight.constant = image.size.height
imageWidth.constant = image.size.width
scrollView.contentSize = image.size
let button = RoundedButton(frame: CGRect(origin: .zero, size: CGSize(width: Cap.mosaicCellSize, height: Cap.mosaicCellSize)))
imageView.addSubview(button)
selectionView = button
button.borderColor = AppDelegate.tintColor
button.borderWidth = 3
button.isHidden = true
scrollView.delegate = self
scrollView.zoomScale = 1
scrollView.maximumZoomScale = 1
setZoomRange()
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTap))
scrollView.addGestureRecognizer(tapRecognizer)
event("did load")
*/
}
override func viewWillAppear(_ animated: Bool) {
@ -127,16 +100,6 @@ class GridViewController: UIViewController {
column = (loc.x - GridViewController.len / 2) / GridViewController.len
}
handleTileTapped(tile: row * columns + Int(column))
/*
event("Tapped")
let loc = sender.location(in: imageView)
guard let tile = Cap.tile(for: loc) else {
event("No tile for location \(loc)")
return
}
handleTileTapped(tile: tile)
*/
}
private func handleTileTapped(tile: Int) {
@ -146,28 +109,7 @@ class GridViewController: UIViewController {
showSelection(tile: tile)
}
}
/*
private func showSelection(tile: Int) {
event("Selecting tile \(tile)")
let point = Cap.origin(for: tile)
selectionView.frame = CGRect(origin: point, size: selectionView.frame.size)
selectionView.isHidden = false
selectedTile = tile
}
private func switchTiles(oldTile: Int, newTile: Int) {
event("Switching tiles \(oldTile) and \(newTile)")
selectionView.isHidden = true
selectedTile = nil
guard oldTile != newTile else {
return
}
Cap.switchTiles(oldTile, newTile)
Cap.switchTilesInMosaic(imageView, tile1: oldTile, tile2: newTile)
}
*/
private var installedTiles = [Int : RoundedImageView]()
private func showSelection(tile: Int) {