Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12618] iOS: Expose New iOS 6 API UIRefreshControl for TableView 'Pull to Refresh'

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-22T20:00:22.000+0000
Affected Version/sRelease 3.1.0
Fix Version/s2013 Sprint 22, 2013 Sprint 22 API, Release 3.2.0
ComponentsiOS
LabelsUIRefreshControl, module_listview, module_tableview, qe-closed-3.2.0, qe-testadded
ReporterSlim McKinsley
AssigneeVishal Duggal
Created2013-01-31T23:48:36.000+0000
Updated2013-10-31T00:19:20.000+0000

Description

UIRefreshControl is a new API in iOS 6.0 to implement "pull to refresh" in the same way the native Apple Mail app does it. This is a feature request to add UIRefreshControl functionality to Titanium's TableView so pull to refresh can easily be implemented in the standard Apple way.

Comments

  1. Fokke Zandbergen 2013-08-02

    A Titanium implementation can be found at: https://github.com/k0sukey/TiExtendView/blob/master/Classes/TiUITableView%2BExtend.m
  2. Ingo Muschenetz 2013-08-07

    [~fokke] Thanks. We'll look at including this in an upcoming release.
  3. Ingo Muschenetz 2013-10-04

    All, in the context of the new iOS 7 refresh control, is there still a strong rationale to pursue this ticket?
  4. Fokke Zandbergen 2013-10-05

    Yes, because in iOS7 it's the exact same control, just different style. So any implementation would work for both iOS6 and iOS7.
  5. Vincent 2013-10-05

    I agree. Besides, it's too early to give up IOS 6. There is a lot of Iphone 3GS et Ipad 1 in the market et this users can't upgrade to IOS 7. It would be nice to have a consistent native UX between IOS 6 and 7
  6. Vishal Duggal 2013-10-21

    Test Case For List View
       var win = Ti.UI.createWindow({
           fullscreen:true
       });
       
       var counter = 0;
       
       function genData()
       {
           var data = [];
           var i=1;
           for (i=1;i<=3;i++) {
               data.push({properties:{title:'ROW '+(counter+i)}})
           }
           counter += 3;
           return data;
       }
       
       var section = Ti.UI.createListSection();
       section.setItems(genData());
       
       var listView = Ti.UI.createListView({
           sections:[section]
       });
       
       var control = Ti.UI.createRefreshControl({
           tintColor:'red'
       })
       
       listView.setRefreshControl(control);
       
       control.addEventListener('refreshstart',function(e){
           Ti.API.info('refreshStart');
           setTimeout(function(){
               Ti.API.debug('Timeout');
               section.appendItems(genData());
               control.endRefreshing();
           }, 2000);
       })
       
       win.add(listView);
       
       win.open();
       
    Test Case for TableView
       var win = Ti.UI.createWindow({
           fullscreen:true
       });
       
       var counter = 0;
       
       function genData()
       {
           var section = Ti.UI.createTableViewSection({ headerTitle: 'Section '+counter });
           section.add(Ti.UI.createTableViewRow({ title: 'Row 1' }));
           section.add(Ti.UI.createTableViewRow({ title: 'Row 2' }));
           counter = counter + 1;
           return section;
       
       }
       
       var tableView = Ti.UI.createTableView({
           data:[genData()]
       });
       
       var control = Ti.UI.createRefreshControl({
           tintColor:'red'
       })
       
       tableView.setRefreshControl(control);
       
       control.addEventListener('refreshstart',function(e){
           Ti.API.info('refreshStart');
           setTimeout(function(){
               Ti.API.debug('Timeout');
               tableView.appendSection(genData())
               control.endRefreshing();
           }, 2000);
       })
       
       win.add(tableView);
       
       win.open();
       
  7. Vishal Duggal 2013-10-21

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4818
  8. Olga Romero 2013-10-31

    Tested and verified "Pull to Refresh" with: Titanium Studio, build: 3.2.0.201310300119 Titanium SDK, build 3.2.0.v20131029150357 CLI 3.2.0 Xcode 5.0 iOs 6.0 simulator iPhone5s 7.0.2

JSON Source