From 90dc3329d1973fda691e357cf4523d5c7c67fa1d Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期二, 11 三月 2025 12:23:53 +0800 Subject: [PATCH] fix bug --- Pods/SwifterSwift/Sources/SwifterSwift/UIKit/UIViewExtensions.swift | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Pods/SwifterSwift/Sources/SwifterSwift/UIKit/UIViewExtensions.swift b/Pods/SwifterSwift/Sources/SwifterSwift/UIKit/UIViewExtensions.swift index 5142596..94280bd 100755 --- a/Pods/SwifterSwift/Sources/SwifterSwift/UIKit/UIViewExtensions.swift +++ b/Pods/SwifterSwift/Sources/SwifterSwift/UIKit/UIViewExtensions.swift @@ -51,7 +51,7 @@ } /// SwifterSwift: Add gradient directions - struct GradientDirection { + struct GradientDirection: Sendable { public static let topToBottom = GradientDirection(startPoint: CGPoint(x: 0.5, y: 0.0), endPoint: CGPoint(x: 0.5, y: 1.0)) public static let bottomToTop = GradientDirection(startPoint: CGPoint(x: 0.5, y: 1.0), @@ -385,7 +385,7 @@ /// SwifterSwift: Remove all gesture recognizers from view. func removeGestureRecognizers() { - gestureRecognizers?.forEach(removeGestureRecognizer) + try? gestureRecognizers?.forEach(removeGestureRecognizer) } /// SwifterSwift: Attaches gesture recognizers to the view. Attaching gesture recognizers to a view defines the @@ -487,12 +487,11 @@ animationType: ShakeAnimationType = .easeOut, completion: (() -> Void)? = nil) { CATransaction.begin() - let animation: CAKeyframeAnimation - switch direction { + let animation = switch direction { case .horizontal: - animation = CAKeyframeAnimation(keyPath: "transform.translation.x") + CAKeyframeAnimation(keyPath: "transform.translation.x") case .vertical: - animation = CAKeyframeAnimation(keyPath: "transform.translation.y") + CAKeyframeAnimation(keyPath: "transform.translation.y") } switch animationType { case .linear: @@ -569,7 +568,7 @@ func fillToSuperview() { // https://videos.letsbuildthatapp.com/ translatesAutoresizingMaskIntoConstraints = false - if let superview = superview { + if let superview { let left = leftAnchor.constraint(equalTo: superview.leftAnchor) let right = rightAnchor.constraint(equalTo: superview.rightAnchor) let top = topAnchor.constraint(equalTo: superview.topAnchor) @@ -610,19 +609,19 @@ var anchors = [NSLayoutConstraint]() - if let top = top { + if let top { anchors.append(topAnchor.constraint(equalTo: top, constant: topConstant)) } - if let left = left { + if let left { anchors.append(leftAnchor.constraint(equalTo: left, constant: leftConstant)) } - if let bottom = bottom { + if let bottom { anchors.append(bottomAnchor.constraint(equalTo: bottom, constant: -bottomConstant)) } - if let right = right { + if let right { anchors.append(rightAnchor.constraint(equalTo: right, constant: -rightConstant)) } -- Gitblit v1.7.1