*Preface*
Not sure if this is an Alloy bug or we should not prefix property names with "on" in the Titanium SDK.
*Description*
Titanium SDK 3.3.0 introduces a new property for iOS that changes the color of the button when it is switched on:
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Switch-property-onTintColor
When using this property in Alloy XML markup, Alloy thinks it's an event.
Property works fine in TSS or Controller code.
*REPRODUCTION and RESULTS*
The code below fails in the simulator with this error:
{noformat}
[ERROR] : Script Error {
[ERROR] : backtrace = "#0 () at file:///Users/bhatfield/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/4D9D3D70-9C78-4444-8A90-3C0277E07381/TestNewApis.app/alloy.js:232";
[ERROR] : line = 34;
[ERROR] : message = "Can't find variable: green";
[ERROR] : name = ReferenceError;
[ERROR] : sourceId = 268417408;
[ERROR] : sourceURL = "file:///Users/bhatfield/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/4D9D3D70-9C78-4444-8A90-3C0277E07381/TestNewApis.app/alloy/controllers/index.js";
[ERROR] : }
{noformat}
*Test Case:*
{noformat}
{noformat}
Alloy assumes any XML attribute beginning with "on" are denoting event listeners. I added on manual workaround for an Android menu property that wasn't a listener. Looks like we'll have to make that more generic now that there are additional properties named with "on" that aren't used to signify event listeners.
PR: https://github.com/appcelerator/alloy/pull/457 Test app: https://github.com/feons/alloy/tree/ALOY-1056/test/apps/testing/ALOY-1056 Functional Test: 1. Compile the test app on iOS 2. onTintColor property works fine, the UI should look like attached screenshots.
PR tested and merged
Verified with: Appc Studio - 3.4.0.201408180158 SDK - 3.4.0.v20140819094113 acs - 1.0.16 alloy - 1.5.0-dev npm - 1.3.2 titanium - 3.4.0-dev titanium-code-processor - 1.1.1 OS - mavericks (v10.9.4) Xcode - 6Beta5 Device - iPhone5s(v8.0) onTintColor working as expected. Hence closing the issue