Attempted fix for swiftlint issue. (#449)

This commit is contained in:
Arunav Sanyal 2017-08-31 10:13:52 -07:00 committed by Lucas Farah
parent f55e27d894
commit dfcedbe274
2 changed files with 3 additions and 5 deletions

View File

@ -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)

View File

@ -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 } })
} }
} }