ios - How to make pagination in tableView? -


i have implemented tableview in app, have large number of data, want show data in pagination, means 10 rows in 1 screen, user can paginate , show 10 rows in next screen.

paging means want scrolling

is possible using existing component? or have create custom controller? if process it?

enter image description here

var allobjectarray: nsmutablearray = [] var elements: nsmutablearray = []  var currentpage = 0 var nextpage = 0  override func viewdidload() {     super.viewdidload()     var = 0; <= 500; i++ {         allobjectarray.addobject(i)     }     elements.addobjectsfromarray(allobjectarray.subarraywithrange(nsmakerange(0, 20))) } override func tableview(tableview: uitableview, willdisplaycell cell: uitableviewcell, forrowatindexpath indexpath: nsindexpath) {         println(indexpath.row)         nextpage = elements.count - 5         if indexpath.row == nextpage {             currentpage++             nextpage = elements.count - 5             elements.addobjectsfromarray(allobjectarray.subarraywithrange(nsmakerange(currentpage, 20)))                 tableview.reloaddata()         }     } 

download sample code here.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -