Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26710] [iOS] Example app.js is incorrect when creating a iOS Swift module

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-02-14T17:47:19.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.0
ComponentsiOS
Labelsn/a
ReporterSamir Mohammed
AssigneeVijay Singh
Created2019-01-10T14:17:24.000+0000
Updated2019-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 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 the app.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';

Comments

  1. Vijay Singh 2019-02-13

    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
  2. Samir Mohammed 2019-02-14

    FR Passed for master and 8_0_X. Awaiting CR and confirmation that this is being included in 8_0_X.
  3. Samir Mohammed 2019-02-15

    *Closing ticket*. Fix verified in SDK Version 8.0.0.v20190214095044 and SDK Version 8.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

JSON Source