[TIMOB-28108] iOS - Ti.UI.RefreshControl crashes when passing a tintColor from TI.UI.fetchSemanticColor
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2020-09-09T11:49:03.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 9.2.0, Release 9.1.1 |
| Components | iOS |
| Labels | n/a |
| Reporter | Ygor Lemos |
| Assignee | Rene Pot |
| Created | 2020-09-02T04:37:00.000+0000 |
| Updated | 2020-09-09T11:49:03.000+0000 |
Description
On Ti 9.0.3.GA, on iOS only, if we pass a valid
Ti.UI.fetchSemanticColor("xxx") to the tintColor of a Ti.UI.RefreshControl, it crashes the app with a message that the view received an instance of TiColor instead of a string.
On Android, passing a semantic color to the tintColor parameter of the RefreshControl works fine.
Tested on both iOS 13 and iOS 14 on 9.0.3.GA
Confirmed as bug on my side. PR: https://github.com/appcelerator/titanium_mobile/pull/12002
Test Case: *Resources/semantic.colors.json*
*Resources/app.js*{ "primaryBackground": { "light": "#efece3", "dark": "#001900" } }const primaryBackground = Ti.UI.fetchSemanticColor('primaryBackground'); 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 control = Ti.UI.createRefreshControl({ tintColor:primaryBackground }); var listView = Ti.UI.createListView({ sections:[section], refreshControl: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();FR Passed Waiting for Jenkins build
Workaround for current 9.2.0: Pass the name of the semantic color directly, e.g.
tintColor: 'primaryBackground'*Closing ticket*. Fix verified in SDK version
9.2.0.v20200908050955, and9.3.0.v20200908051946. *Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/12002