[TIMOB-24027] Hyperloop: iOS - Provide migration help for new properties
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-10-17T16:50:59.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0, Hyperloop 2.0.0 |
Components | Hyperloop, iOS |
Labels | n/a |
Reporter | Jan Vennemann |
Assignee | Jan Vennemann |
Created | 2016-10-12T23:33:51.000+0000 |
Updated | 2016-10-21T23:19:18.000+0000 |
Description
We changed the API to access certain properties in TIMOB-23911. This breaking change will result in error messages like the following:
UIColor.redColor is not a function
To let the user know why this fails and to help them migrate their code, we can use the old list of properties that were used for the workaround in 1.2.8 to display a help message.
Something like this:
It looks like you used the function UIColor.redColor() in your code. Due to changes introduced in iOS 10 and Hyperloop 2.0.0 this method is now a property and must be used like this: UIColor.redColor.
PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/92 PR (master): https://github.com/appcelerator/hyperloop.next/pull/93
Test-case:
Tested with this environment: NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.11.6 Appc CLI: 5.5.1 Appc CLI NPM: 4.2.7 Titanium SDK version: 6.0.0.v20161019091022 Appcelerator Studio, build: 4.8.0.201610171310 Xcode 8.0 GM Hyperloop version 2.0.0 Using SDK 5.5.1/Hyperloop 1.2.8, and the above demo code, an error message was seen when pressing the button on the app: "[KrollCallback CGColor]: unrecognized selector sent to instance 0x60000026e380" With SDK 6.0.0/Hyperloop 2.0.0 while running the demo code, a message in Studio console was displayed: [ERROR] : !!! CODE MIGRATION REQUIRED !!! [ERROR] : Due to changes introduced in iOS 10 and Hyperloop 2.0.0 some method calls need [ERROR] : to be changed to property access. ... [ERROR] : Line 7: UIColor.redColor() -> UIColor.redColor The migration message appears to be displayed correctly in the console