[TIMOB-26710] [iOS] Example app.js is incorrect when creating a iOS Swift module
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-02-14T17:47:19.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.0.0 |
Components | iOS |
Labels | n/a |
Reporter | Samir Mohammed |
Assignee | Vijay Singh |
Created | 2019-01-10T14:17:24.000+0000 |
Updated | 2019-02-15T14:50:19.000+0000 |
Description
When creating a iOS test module using Swift the example app.js is incorrect and throws errors.
*Test Steps:*
Create a new test module using
Package the module using
Copy the example found in
Create a new test module using ti create -t module --name test --id com.example.tese --code-base swift
Package the module using appc run -p ios --build-only
(iOS folder within the module)
Create a new Titanium project
Copy the example found in TEST_Module -> example -> app.js
in to Titaniums app.js
Add the packaged module in to the application
Run the program
*Actual results* Application shows errors as the correct methods/properties can not be found at *Expected result* Application should run fine with theapp.js
from the example folder in the module
*Note* The following example should work
var test = require('com.example.tese');
Ti.API.info('module is => ' + test);
Ti.API.info('module tryThis method returns => ' + test.tryThis());
Ti.API.info('module exampleProp is => ' + test.testProperty);
test.testProperty = 'Should equal Hello World';
Updated the template similar to objective c example. PR (master) - https://github.com/appcelerator/titanium_mobile/pull/10698 PR (8_0_X) - https://github.com/appcelerator/titanium_mobile/pull/10699
FR Passed for master and 8_0_X. Awaiting CR and confirmation that this is being included in 8_0_X.
*Closing ticket*. Fix verified in SDK Version
8.0.0.v20190214095044
and SDK Version8.1.0.v20190214095127
Test and other information can found at: PR (master) - https://github.com/appcelerator/titanium_mobile/pull/10698 PR (8_0_X) - https://github.com/appcelerator/titanium_mobile/pull/10699