Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24027] Hyperloop: iOS - Provide migration help for new properties

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-10-17T16:50:59.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0, Hyperloop 2.0.0
ComponentsHyperloop, iOS
Labelsn/a
ReporterJan Vennemann
AssigneeJan Vennemann
Created2016-10-12T23:33:51.000+0000
Updated2016-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.

Comments

  1. Jan Vennemann 2016-10-14

    PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/92 PR (master): https://github.com/appcelerator/hyperloop.next/pull/93
  2. Hans Knöchel 2016-10-17

    Test-case:
       var index = Ti.UI.createWindow();
       
       var UIView = require("UIKit/UIView");
       var UIColor = require("UIKit/UIColor");
       
       var view = new UIView();
       view.setBackgroundColor(UIColor.redColor());
       
       var btn = Ti.UI.createButton({
           title: "Change to green"
       });
       
       btn.addEventListener("click", function() {
           view.setBackgroundColor(UIColor.greenColor);
       });
       
       index.add(view);
       index.add(btn);
       index.open();
       
  3. Abir Mukherjee 2016-10-21

    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

JSON Source