Implemented find on page UI

This commit is contained in:
James Magahern
2020-09-30 18:06:47 -07:00
parent 1d27674d7d
commit 3769f5bbbf
12 changed files with 372 additions and 9 deletions

View File

@@ -9,6 +9,8 @@ import UIKit
class ReliefButton: UIButton
{
public var constrainedToSquare = true
internal let shadowView = UIView(frame: .zero)
internal let backgroundView = GradientView(direction: .vertical, colors: ReliefButton.gradientColors(inverted: false, darkMode: false))
@@ -140,9 +142,14 @@ class ReliefButton: UIButton
sendSubviewToBack(backgroundView)
sendSubviewToBack(shadowView)
let backgroundDimension = bounds.height
backgroundView.frame = CGRect(origin: .zero, size: CGSize(width: backgroundDimension, height: backgroundDimension))
backgroundView.frame = backgroundView.frame.centeredX(inRect: bounds)
if constrainedToSquare {
let backgroundDimension = bounds.height
backgroundView.frame = CGRect(origin: .zero, size: CGSize(width: backgroundDimension, height: backgroundDimension))
backgroundView.frame = backgroundView.frame.centeredX(inRect: bounds)
} else {
backgroundView.frame = bounds
}
shadowView.frame = backgroundView.frame
}
}