jeremy 5 år sedan
förälder
incheckning
42a906b569

+ 9 - 13
RainbowPlanet/RainbowPlanet.xcodeproj/xcshareddata/xcschemes/RainbowPlanet.xcscheme

@@ -27,6 +27,15 @@
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       shouldUseLaunchSchemeArgsEnv = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "A77F2C5C2231FB49001BD3F6"
+            BuildableName = "RainbowPlanet.app"
+            BlueprintName = "RainbowPlanet"
+            ReferencedContainer = "container:RainbowPlanet.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
       <Testables>
          <TestableReference
             skipped = "NO">
@@ -49,17 +58,6 @@
             </BuildableReference>
          </TestableReference>
       </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "A77F2C5C2231FB49001BD3F6"
-            BuildableName = "RainbowPlanet.app"
-            BlueprintName = "RainbowPlanet"
-            ReferencedContainer = "container:RainbowPlanet.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
    </TestAction>
    <LaunchAction
       buildConfiguration = "Debug"
@@ -89,8 +87,6 @@
             isEnabled = "YES">
          </EnvironmentVariable>
       </EnvironmentVariables>
-      <AdditionalOptions>
-      </AdditionalOptions>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

+ 1 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -306,10 +306,8 @@ extension CommunityFeaturedTopicsViewController {
             [weak self] (communityTopicDetailModel) -> (Void) in
             self?.communityTopicDetailModel = communityTopicDetailModel as? CommunityTopicDetailModel
             self?.topicLable.text = self?.communityTopicDetailModel?.name
-            CommunityFollowTopicViewModel.shared.followTopicButton(communityTopicDetailModel: self?.communityTopicDetailModel, button: (self?.focusButton)!)
+            CommunityFollowTopicViewModel.shared.followTopicButton(communityTopicDetailModel: self?.communityTopicDetailModel, button: self?.focusButton)
             self?.bgImageView.kf.setImage(with: kURLImage(name: self?.communityTopicDetailModel?.img ?? ""), placeholder: kImage(name: "default_pic"))
-            //KingfisherManager.shared.cache.clearMemoryCache()
-
             self?.navigationBar.barBackgroundImage = self?.bgImageView.image
             self?.communityFeaturedTopicsHeaderView.communityTopicDetailModel = self?.communityTopicDetailModel
             self?.tableView.tableHeaderView = self?.communityFeaturedTopicsHeaderView

+ 18 - 7
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -131,7 +131,13 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         
         addSubview(playStatusImageView)
         
-        self.addTapGesture(1, target: self, action:  #selector(tapView(doubleTap:)))
+        
+//        self.addTapGesture(1, target: self, action:  #selector(tapView(doubleTap:)))
+        let tap = UITapGestureRecognizer(target: self, action: #selector(tapView(doubleTap:)))
+        tap.numberOfTapsRequired = 1
+        tap.delegate = self
+        addGestureRecognizer(tap)
+        isUserInteractionEnabled = true
     }
     
     @objc  func tapView(doubleTap:UITapGestureRecognizer) {
@@ -164,9 +170,6 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
                 
             }
             YPDouYinLikeAnimation.shareInstance()?.createAnimation(withTap: doubleTap)
-            
-            
-
         }
         //更新上一次点击时间
         lastTapTime = time
@@ -350,7 +353,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
             ])
         
         let moreString = " 展开"
-        let text = NSMutableAttributedString(string: "... \(moreString)")
+        let text = NSMutableAttributedString(string: "...\(moreString)")
         let expandRange = (text.string as NSString).range(of: moreString)
         
         text.addAttribute(.foregroundColor, value: kffffffColor, range: expandRange)
@@ -438,7 +441,6 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     // MARK: 视频播放View
     lazy var videoPlayView: CommunityVideoPlayView = {
         let videoPlayView = CommunityVideoPlayView()
-        videoPlayView.isUserInteractionEnabled = true
         return videoPlayView
     }()
     
@@ -693,6 +695,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         contentLabel.numberOfLines = 0;
         contentLabel.textColor = kffffffColor
         contentLabel.font = kRegularFont14
+        
         return contentLabel
     }()
     
@@ -1041,5 +1044,13 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         bottomGradientView.layer.cornerRadius = 2;
         bottomGradientView.alpha = 1
     }
-    
+}
+
+extension CommunityVideoCoverCollectionCell : UIGestureRecognizerDelegate {
+    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
+        if touch.view is YYLabel {
+            return false
+        }
+        return true
+    }
 }

+ 21 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoSelTopicCell.swift

@@ -8,14 +8,11 @@
 
 import UIKit
 import RxSwift
+import SwiftyMediator
 
 class CommunityVideoSelTopicCell: UICollectionViewCell {
     
-    var topicMdl: CommunityVideoTopicModel? {
-        didSet {
-            titleLabel.text = self.topicMdl?.name
-        }
-    }
+
     
     let disposeBag = DisposeBag()
     
@@ -50,6 +47,7 @@ class CommunityVideoSelTopicCell: UICollectionViewCell {
     private func setupViews() {
         addSubview(iconImageView)
         addSubview(titleLabel)
+        setupData()
     }
     
     private func setupLayouts() {
@@ -66,6 +64,18 @@ class CommunityVideoSelTopicCell: UICollectionViewCell {
         }
     }
     
+    func setupData() {
+        addTapGesture(1, target: self, action: #selector(titleLabelAction))
+    }
+    
+    @objc func titleLabelAction() {
+        if UserModel.isTokenNil() {
+            kAppDelegate.setLogin()
+        }else {
+            Mediator.push(CommunityRouterModuleType.pushFeaturedTopics(id: topicMdl?.id ?? 0))
+        }
+    }
+    
     private lazy var iconImageView: UIImageView = {
         let iconImageView = UIImageView()
         iconImageView.image = kImage(name: "edit_ico_topic_pre")
@@ -80,4 +90,10 @@ class CommunityVideoSelTopicCell: UICollectionViewCell {
         return titleLabel
     }()
     
+    var topicMdl: CommunityVideoTopicModel? {
+        didSet {
+            titleLabel.text = self.topicMdl?.name
+        }
+    }
+    
 }

+ 8 - 8
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoTopicView.swift

@@ -76,13 +76,13 @@ extension CommunityVideoTopicView: UICollectionViewDelegateFlowLayout,UICollecti
         return UIEdgeInsets(top: 6, left: 14, bottom: 15, right: 14)
     }
     
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        if UserModel.isTokenNil() {
-            kAppDelegate.setLogin()
-        }else {
-            let topicMdl = topicArray?[indexPath.row]
-            Mediator.push(CommunityRouterModuleType.pushFeaturedTopics(id: topicMdl?.id ?? 0))
-        }
-    }
+//    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+//        if UserModel.isTokenNil() {
+//            kAppDelegate.setLogin()
+//        }else {
+//            let topicMdl = topicArray?[indexPath.row]
+//            Mediator.push(CommunityRouterModuleType.pushFeaturedTopics(id: topicMdl?.id ?? 0))
+//        }
+//    }
     
 }

+ 10 - 10
RainbowPlanet/RainbowPlanet/ViewModel/Community/CommunityFollowTopicViewModel.swift

@@ -57,22 +57,22 @@ extension CommunityFollowTopicViewModel {
     }
     
     
-    func followTopicButton(communityTopicDetailModel:CommunityTopicDetailModel?,button:UIButton) {
+    func followTopicButton(communityTopicDetailModel:CommunityTopicDetailModel?,button:UIButton?) {
         if communityTopicDetailModel?.isFollow == 1 {
-            button.isSelected = true
-            button.layer.borderColor = kffffffColor.cgColor
+            button?.isSelected = true
+            button?.layer.borderColor = kffffffColor.cgColor
         }else {
-            button.isSelected = false
-            button.layer.borderColor = kThemeColor.cgColor
+            button?.isSelected = false
+            button?.layer.borderColor = kThemeColor.cgColor
         }
     }
-    func followTopicListButton(communityTopicDetailModel:CommunityTopicDetailModel?,button:UIButton) {
+    func followTopicListButton(communityTopicDetailModel:CommunityTopicDetailModel?,button:UIButton?) {
         if communityTopicDetailModel?.isFollow == 1 {
-            button.isSelected = true
-            button.layer.borderColor = kf7f8faColor.cgColor
+            button?.isSelected = true
+            button?.layer.borderColor = kf7f8faColor.cgColor
         }else {
-            button.isSelected = false
-            button.layer.borderColor = kThemeColor.cgColor
+            button?.isSelected = false
+            button?.layer.borderColor = kThemeColor.cgColor
         }
     }