Attempted fix for swiftlint issue.
This commit is contained in:
parent
f55e27d894
commit
f502de96c2
|
@ -11,16 +11,14 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
extension UIButton {
|
extension UIButton {
|
||||||
/// EZSwiftExtensions
|
|
||||||
|
|
||||||
// swiftlint:disable function_parameter_count
|
/// EZSwiftExtensions: Convenience constructor for UIButton.
|
||||||
public convenience init(x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat, target: AnyObject, action: Selector) {
|
public convenience init(x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat, target: AnyObject, action: Selector) {
|
||||||
self.init(frame: CGRect(x: x, y: y, width: w, height: h))
|
self.init(frame: CGRect(x: x, y: y, width: w, height: h))
|
||||||
addTarget(target, action: action, for: UIControlEvents.touchUpInside)
|
addTarget(target, action: action, for: UIControlEvents.touchUpInside)
|
||||||
}
|
}
|
||||||
// swiftlint:enable function_parameter_count
|
|
||||||
|
|
||||||
/// EZSwiftExtensions
|
/// EZSwiftExtensions: Set a background color for the button.
|
||||||
public func setBackgroundColor(_ color: UIColor, forState: UIControlState) {
|
public func setBackgroundColor(_ color: UIColor, forState: UIControlState) {
|
||||||
UIGraphicsBeginImageContext(CGSize(width: 1, height: 1))
|
UIGraphicsBeginImageContext(CGSize(width: 1, height: 1))
|
||||||
UIGraphicsGetCurrentContext()?.setFillColor(color.cgColor)
|
UIGraphicsGetCurrentContext()?.setFillColor(color.cgColor)
|
||||||
|
|
|
@ -449,7 +449,7 @@ extension UIView {
|
||||||
setScale(x: 0.9, y: 0.9)
|
setScale(x: 0.9, y: 0.9)
|
||||||
UIView.animate(withDuration: 0.05, delay: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: { [weak self] _ in
|
UIView.animate(withDuration: 0.05, delay: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: { [weak self] _ in
|
||||||
self?.setScale(x: 1, y: 1)
|
self?.setScale(x: 1, y: 1)
|
||||||
}) { (_) in }
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue