Quellcode durchsuchen

Merge commit '3b928838b34d503438ee0be4296aa6ca2fc28f13' into dev

yanxuyao vor 14 Stunden
Ursprung
Commit
44fe2d6533

+ 4 - 4
Lanu.xcodeproj/project.pbxproj

@@ -675,7 +675,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = Lanu/Lanu.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 38;
+				CURRENT_PROJECT_VERSION = 39;
 				DEVELOPMENT_TEAM = 5H8D98R72W;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -696,7 +696,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.5.0;
+				MARKETING_VERSION = 1.5.1;
 				PRODUCT_BUNDLE_IDENTIFIER = com.jiehe.gami;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -724,7 +724,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = Lanu/Lanu.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 38;
+				CURRENT_PROJECT_VERSION = 39;
 				DEVELOPMENT_TEAM = 5H8D98R72W;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -745,7 +745,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.5.0;
+				MARKETING_VERSION = 1.5.1;
 				PRODUCT_BUNDLE_IDENTIFIER = com.jiehe.gami;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				STRING_CATALOG_GENERATE_SYMBOLS = YES;

+ 1 - 1
Lanu/Common/Views/ImagePreview/LNImagePreviewController.swift

@@ -38,7 +38,7 @@ class LNImagePreviewController: LNViewController {
         curIndex = targetIndex
         
         collectionView?.reloadData()
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             collectionView?.scrollToItem(
                 at: .init(row: curIndex, section: 0),

+ 1 - 1
Lanu/Common/Views/Selection/LNHourRangePickerPanel.swift

@@ -188,7 +188,7 @@ extension LNHourRangePickerPanel {
             make.top.equalTo(pickerView.snp.bottom).offset(4)
         }
         
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             fromPicker.subviews.forEach {
                 if $0.subviews.isEmpty {

+ 1 - 1
Lanu/Common/Views/VideoPreview/LNVideoPreviewController.swift

@@ -38,7 +38,7 @@ class LNVideoPreviewController: LNViewController {
         curIndex = targetIndex
         
         collectionView?.reloadData()
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             collectionView?.scrollToItem(
                 at: .init(row: curIndex, section: 0),

+ 1 - 1
Lanu/Common/Voice/LNVoiceRecorder.swift

@@ -67,7 +67,7 @@ class LNVoiceRecorder {
         curState = .recording
         curTaskId = "\(curTime)"
         
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             notifyTaskStart()
         }

+ 6 - 20
Lanu/Views/Game/Category/LNGameCategoryListView.swift

@@ -50,19 +50,14 @@ class LNGameCategoryListView: UIView {
         guard let index = categories.firstIndex(where: { $0.code == category.code }) else {
             return
         }
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
-            let sections = collectionView.numberOfSections
-            guard sections > 0, index < sections else { return }
-            collectionView.layoutIfNeeded()
             if let headerAttributes = collectionView.layoutAttributesForSupplementaryElement(
                 ofKind: UICollectionView.elementKindSectionHeader,
                 at: IndexPath(item: 0, section: index))
             {
                 collectionView.setContentOffset(.init(x: 0, y: headerAttributes.frame.origin.y), animated: true)
             } else {
-                let items = collectionView.numberOfItems(inSection: index)
-                guard items > 0 else { return }
                 collectionView.scrollToItem(at: .init(row: 0, section: index), at: .top, animated: true)
             }
         }
@@ -74,7 +69,7 @@ class LNGameCategoryListView: UIView {
         let width = (bounds.width - collectionViewLayout.minimumInteritemSpacing) / CGFloat(columns) - collectionViewLayout.minimumInteritemSpacing
         collectionViewLayout.itemSize = .init(width: width, height: 68)
         
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             fixBottomSpace()
         }
@@ -87,14 +82,10 @@ class LNGameCategoryListView: UIView {
 
 extension LNGameCategoryListView: UIScrollViewDelegate {
     func scrollViewDidScroll(_ scrollView: UIScrollView) {
-        guard !categories.isEmpty else { return }
         let offsetY = scrollView.contentOffset.y
         
-        let sections = collectionView.numberOfSections
-        guard sections > 0 else { return }
-        
         var section = 0
-        for index in 0..<min(categories.count, sections) {
+        for index in 0..<categories.count {
             if let headerAttributes = collectionView.layoutAttributesForSupplementaryElement(
                 ofKind: UICollectionView.elementKindSectionHeader,
                 at: IndexPath(item: 0, section: index)) {
@@ -151,16 +142,11 @@ extension LNGameCategoryListView: UICollectionViewDataSource, UICollectionViewDe
 extension LNGameCategoryListView {
     private func fixBottomSpace() {
         guard !categories.isEmpty else { return }
-        let sections = collectionView.numberOfSections
-        guard sections > 0 else { return }
-        collectionView.layoutIfNeeded()
-        let lastSection = min(categories.count - 1, sections - 1)
         if let headerAttributes = collectionView.layoutAttributesForSupplementaryElement(
             ofKind: UICollectionView.elementKindSectionHeader,
-            at: IndexPath(item: 0, section: lastSection)) {
-            let offset = max(0, collectionView.contentSize.height - headerAttributes.frame.origin.y)
-            let inset = max(0, bounds.height - offset)
-            collectionView.contentInset = .init(top: 0, left: 0, bottom: inset, right: 0)
+            at: IndexPath(item: 0, section: categories.count - 1)) {
+            let offset = collectionView.contentSize.height - headerAttributes.frame.origin.y
+            collectionView.contentInset = .init(top: 0, left: 0, bottom: bounds.height - offset, right: 0)
         }
     }
     

+ 0 - 1
Lanu/Views/Game/MateFilter/LNGameCategoryFilterPanel.swift

@@ -60,7 +60,6 @@ extension LNGameCategoryFilterPanel: UICollectionViewDataSource, UICollectionVie
 
 extension LNGameCategoryFilterPanel {
     private func handleClickTab(view: UIView, typeItem: LNGameTypeItemVO) {
-        guard let superview = indicator.superview, view.isDescendant(of: superview) else { return }
         indicator.isHidden = false
         indicator.snp.remakeConstraints { make in
             make.edges.equalTo(view).inset(4)

+ 1 - 1
Lanu/Views/Order/OrderQR/LNOrderGenerateQRCodePanel.swift

@@ -33,7 +33,7 @@ class LNOrderGenerateQRCodePanel: LNPopupView {
         
         setupViews()
         
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             tabView.curType = .normal
             curSkill = myUserInfo.skills.first

+ 1 - 1
Lanu/Views/Room/Base/Views/Gift/LNRoomGiftBottomView.swift

@@ -56,7 +56,7 @@ class LNRoomGiftBottomView: UIView {
         setupViews()
         LNEventDeliver.addObserver(self)
         
-        runOnMain { [weak self] in
+        DispatchQueue.main.async { [weak self] in
             guard let self else { return }
             curCount = 1
             enable = false