xcode 从 XIB 文件转换到 Storyboard

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7798400/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:10:05  来源:igfitidea点击:

Transitioning from XIB files to Storyboard

iphoneiosxcodexibstoryboard

提问by benuuu

I currently have an XCode project that uses XIBs and would like to start using Storyboards. Is there a good way to move my XIB files into the Storyboard?

我目前有一个使用 XIB 的 XCode 项目,并想开始使用故事板。有没有一种好方法可以将我的 XIB 文件移动到故事板中?

回答by Sumesh Sivan

You can do this manually one view controller at a time.

您可以一次手动执行一个视图控制器。

  1. Copy the view from xib (? c).
  1. 从 xib (? c) 复制视图。

enter image description here

在此处输入图片说明

  1. Go to storyboard and create a new view controller in it. Then select the view of that view controller and hit paste (? v).
  1. 转到故事板并在其中创建一个新的视图控制器。然后选择该视图控制器的视图并点击粘贴 (?v)。

enter image description here

在此处输入图片说明