فهرست منبع

Update editor

kevin 2 سال پیش
والد
کامیت
da9ffe5e06

+ 9 - 6
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -120,8 +120,9 @@ public class EditorGroup: UIViewController {
         if indexPath != nil {
             let headerRect = tableChatView.rectForHeader(inSection: indexPath!.section)
             let isPinned = headerRect.origin.y <= tableChatView.contentOffset.y
-            if listViewOnSection.count != 0 && listViewOnSection.count - 1 <= indexPath!.section && isPinned {
-                let headerView = listViewOnSection[currentIndexpath!.section]
+            if listViewOnSection.count != 0 && listViewOnSection.count - 1 == indexPath!.section && isPinned {
+                let sect = listViewOnSection.count - 1 < currentIndexpath!.section ? listViewOnSection.count - 1 : currentIndexpath!.section
+                let headerView = listViewOnSection[sect]
                 headerView.isHidden = true
             }
         }
@@ -4578,8 +4579,9 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
         if indexPath != nil {
             let headerRect = tableChatView.rectForHeader(inSection: indexPath!.section)
             let isPinned = headerRect.origin.y <= scrollView.contentOffset.y
-            if listViewOnSection.count != 0 && listViewOnSection.count - 1 <= indexPath!.section && indexPath!.row > 0 {
-                let headerView = listViewOnSection[currentIndexpath!.section]
+            if listViewOnSection.count != 0 && listViewOnSection.count - 1 == indexPath!.section && indexPath!.row > 0 {
+                let sect = listViewOnSection.count - 1 < currentIndexpath!.section ? listViewOnSection.count - 1 : currentIndexpath!.section
+                let headerView = listViewOnSection[sect]
                 headerView.isHidden = true
             }
         }
@@ -4591,8 +4593,9 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
             if indexPath != nil {
                 let headerRect = tableChatView.rectForHeader(inSection: indexPath!.section)
                 let isPinned = headerRect.origin.y <= scrollView.contentOffset.y
-                if listViewOnSection.count != 0 && listViewOnSection.count - 1 <= indexPath!.section && isPinned {
-                    let headerView = listViewOnSection[currentIndexpath!.section]
+                if listViewOnSection.count != 0 && listViewOnSection.count - 1 == indexPath!.section && isPinned {
+                    let sect = listViewOnSection.count - 1 < currentIndexpath!.section ? listViewOnSection.count - 1 : currentIndexpath!.section
+                    let headerView = listViewOnSection[sect]
                     headerView.isHidden = true
                 }
             }

+ 9 - 6
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -138,8 +138,9 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
         if indexPath != nil {
             let headerRect = tableChatView.rectForHeader(inSection: indexPath!.section)
             let isPinned = headerRect.origin.y <= tableChatView.contentOffset.y
-            if listViewOnSection.count != 0 && listViewOnSection.count - 1 <= indexPath!.section && isPinned {
-                let headerView = listViewOnSection[currentIndexpath!.section]
+            if listViewOnSection.count != 0 && listViewOnSection.count - 1 == indexPath!.section && isPinned {
+                let sect = listViewOnSection.count - 1 < currentIndexpath!.section ? listViewOnSection.count - 1 : currentIndexpath!.section
+                let headerView = listViewOnSection[sect]
                 headerView.isHidden = true
             }
         }
@@ -5952,8 +5953,9 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
         if indexPath != nil {
             let headerRect = tableChatView.rectForHeader(inSection: indexPath!.section)
             let isPinned = headerRect.origin.y <= scrollView.contentOffset.y
-            if listViewOnSection.count != 0 && listViewOnSection.count - 1 <= indexPath!.section && indexPath!.row > 0 {
-                let headerView = listViewOnSection[currentIndexpath!.section]
+            if listViewOnSection.count != 0 && listViewOnSection.count - 1 == indexPath!.section && indexPath!.row > 0 {
+                let sect = listViewOnSection.count - 1 < currentIndexpath!.section ? listViewOnSection.count - 1 : currentIndexpath!.section
+                let headerView = listViewOnSection[sect]
                 headerView.isHidden = true
             }
         }
@@ -5965,8 +5967,9 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
             if indexPath != nil {
                 let headerRect = tableChatView.rectForHeader(inSection: indexPath!.section)
                 let isPinned = headerRect.origin.y <= scrollView.contentOffset.y
-                if listViewOnSection.count != 0 && listViewOnSection.count - 1 <= indexPath!.section && isPinned {
-                    let headerView = listViewOnSection[currentIndexpath!.section]
+                if listViewOnSection.count != 0 && listViewOnSection.count - 1 == indexPath!.section && isPinned {
+                    let sect = listViewOnSection.count - 1 < currentIndexpath!.section ? listViewOnSection.count - 1 : currentIndexpath!.section
+                    let headerView = listViewOnSection[sect]
                     headerView.isHidden = true
                 }
             }