100Years il y a 2 semaines
Parent
commit
4a3717b792

+ 1 - 1
TSSmalCoacopods/Classes/Ex/UIView+Animation.swift

@@ -44,7 +44,7 @@ public extension UIView {
     ///   - images: 要切换的图片数组
     ///   - interval: 切换间隔时间,默认2秒
     ///   - duration: 溶解动画持续时间,默认0.5秒
-    func startImageTransitionAnimation(index:Int = 0, datas: [Any], interval: TimeInterval = 4.0, duration: TimeInterval = 2.0,options: UIView.AnimationOptions = [.transitionCrossDissolve, .curveEaseInOut],setImageHandle:@escaping (Int,Any?)->Void) {
+    func startImageTransitionAnimation(index:Int = 0, datas: [Any], interval: TimeInterval = 2.0, duration: TimeInterval = 1.0,options: UIView.AnimationOptions = [.transitionCrossDissolve, .curveEaseInOut],setImageHandle:@escaping (Int,Any?)->Void) {
         guard datas.count > 0 else { return }
         
         // 停止已有的动画

+ 9 - 5
TSSmalCoacopods/Classes/Tool/TSCustomAlertController.swift

@@ -72,12 +72,16 @@ public class TSCustomAlertController {
         cancelAction.setValue(config.cancelColor, forKey: "titleTextColor")
         alert.addAction(cancelAction)
         
-        // 4. 添加确定按钮
-        let confirmAction = UIAlertAction(title: config.confirmTitle, style: .default) { _ in
-            config.confirmAction?()
+        
+        if config.confirmTitle.count > 0 {
+            // 4. 添加确定按钮
+            let confirmAction = UIAlertAction(title: config.confirmTitle, style: .default) { _ in
+                config.confirmAction?()
+            }
+            confirmAction.setValue(config.confirmColor, forKey: "titleTextColor")
+            alert.addAction(confirmAction)
         }
-        confirmAction.setValue(config.confirmColor, forKey: "titleTextColor")
-        alert.addAction(confirmAction)
+
         
         // 5. 显示弹窗
         viewController.present(alert, animated: true)

+ 10 - 1
TSSmalCoacopods/Classes/View/TSSaveSuccessTool/TSSaveSuccessTool.swift

@@ -25,7 +25,7 @@ open class TSSaveSuccessTool {
     }()
     
     
-    private lazy var viewButton:UIView = {
+    private lazy var viewButton:UIButton = {
         let color = "4FEA9D".uiColor
         let viewButton = UIButton.createButton(title: "View".localized ,backgroundColor: color.withAlphaComponent(0.1),font: UIFont.font(size: 12),titleColor: color,corner: 14) { [weak self]  in
             guard let self = self else { return }
@@ -116,6 +116,15 @@ open class TSSaveSuccessTool {
                 make.centerX.equalToSuperview()
                 make.top.equalTo(k_Nav_Height + 10)
             }
+            
+            
+            self.viewButton.setTitle("View".localized, for: .normal)
+            self.viewButton.snp.remakeConstraints { make in
+                make.width.equalTo(self.viewButton.intrinsicContentSize.width)
+                make.height.equalTo(28)
+                make.trailing.equalTo(-8)
+                make.centerY.equalToSuperview()
+            }
         }
 
         DispatchQueue.main.asyncAfter(deadline: .now() + deadline) {