浏览代码

start prefetch activity

Marino Faggiana 6 年之前
父节点
当前提交
488f7041a8
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 1 0
      iOSClient/Activity/NCActivity.storyboard
  2. 9 3
      iOSClient/Activity/NCActivity.swift

+ 1 - 0
iOSClient/Activity/NCActivity.storyboard

@@ -118,6 +118,7 @@
                                 <connections>
                                 <connections>
                                     <outlet property="dataSource" destination="nhT-TJ-YvX" id="4jS-6C-FKt"/>
                                     <outlet property="dataSource" destination="nhT-TJ-YvX" id="4jS-6C-FKt"/>
                                     <outlet property="delegate" destination="nhT-TJ-YvX" id="ab1-4g-bMH"/>
                                     <outlet property="delegate" destination="nhT-TJ-YvX" id="ab1-4g-bMH"/>
+                                    <outlet property="prefetchDataSource" destination="nhT-TJ-YvX" id="317-AD-uQe"/>
                                 </connections>
                                 </connections>
                             </tableView>
                             </tableView>
                         </subviews>
                         </subviews>

+ 9 - 3
iOSClient/Activity/NCActivity.swift

@@ -25,7 +25,7 @@ import Foundation
 import UIKit
 import UIKit
 import SwiftRichString
 import SwiftRichString
 
 
-class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
+class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate, UITableViewDataSourcePrefetching, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
     
     
     @IBOutlet weak var tableView: UITableView!
     @IBOutlet weak var tableView: UITableView!
 
 
@@ -46,8 +46,6 @@ class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate,
         tableView.allowsSelection = false
         tableView.allowsSelection = false
         tableView.separatorColor = UIColor.clear
         tableView.separatorColor = UIColor.clear
         tableView.tableFooterView = UIView()
         tableView.tableFooterView = UIView()
-        
-        // Add Refresh Control
         tableView.refreshControl = refreshControl
         tableView.refreshControl = refreshControl
         
         
         // Configure Refresh Control
         // Configure Refresh Control
@@ -155,6 +153,14 @@ class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate,
         return UITableView.automaticDimension
         return UITableView.automaticDimension
     }
     }
     
     
+    func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) {
+        print("")
+    }
+    
+    func tableView(_ tableView: UITableView, cancelPrefetchingForRowsAt indexPaths: [IndexPath]) {
+        print("")
+    }
+    
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         
         
         if let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath) as? activityTableViewCell {
         if let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath) as? activityTableViewCell {