官术网_书友最值得收藏!

Swift migration assistant

If you open your project with Xcode 9 for the first time, you will see a migration opportunity item in the Issue Navigator; click on it to activate a sheet asking you if you'd like to migrate. You can be reminded later or invoke the migrator manually from the menu—Edit | Convert | To Current Swift Syntax…

You will be given a list of targets to migrate. Only those targets that contain Swift code will be selected.

There is only one migration workflow this year, although there is a choice between two kinds of @objc inference:

  • Minimize inference: Add an @objc attribute to your code only where it is needed based on static inference. After using this option, you need to follow the manual steps.
  • Match Swift 3 behavior: Add an @objc attribute to your code anywhere it would be implicitly inferred by the compiler. This option does not change the size of your binary as it adds explicit @objc attributes everywhere.

Clicking on Next will bring up the Generate Preview sheet and a migration build will be initiated by the assistant to get source changes. Once this is completed, you will be shown all the changes that will be applied when you click on Save. This will also change the Swift language version build setting for the migrated targets to Swift 4.

You may find some issues while processing the targets during the migration process. You can check the log for these errors by switching to report navigator and converting the entry that was added.

主站蜘蛛池模板: 山东| 剑河县| 广元市| 监利县| 潮州市| 临洮县| 四子王旗| 兴国县| 诏安县| 泗阳县| 萝北县| 和静县| 上栗县| 沁水县| 十堰市| 象山县| 庆安县| 泾源县| 灌阳县| 竹北市| 花垣县| 磐石市| 新泰市| 黄平县| 乌什县| 苍溪县| 韶关市| 福建省| 壤塘县| 抚顺市| 额济纳旗| 汽车| 离岛区| 盈江县| 长武县| 浦城县| 南涧| 青神县| 政和县| 民乐县| 儋州市|