简体   繁体   English

如何用.xib快速创建UIViewController子类?

[英]How to create a UIViewController subclass with .xib in swift?

在此处输入图片说明 I am familiar with Objective C . 我对Objective C很熟悉。 And learning Swift . 并学习Swift

I want to reuse my .xib file designs with Swift . 我想在Swift重用我的.xib文件设计。

But when i create a new file the Create xib UI is disabled . 但是当我创建一个新文件时,“ Create xib UI被禁用。

For some reason Xcode 7 has started defaulting to the OS X controls when I ask for a new file... 由于某些原因,当我请求新文件时,Xcode 7已经开始默认使用OS X控件...

在此处输入图片说明

If you select this option and hit next then you cannot create a xib... 如果选择此选项并单击下一步,则无法创建xib ...

在此处输入图片说明

However, if you change to use the iOS files instead... 但是,如果您改为使用iOS文件...

在此处输入图片说明

You then have the option to create a xib with your view controller... 然后,您可以选择使用视图控制器创建xib。

在此处输入图片说明

Hope that helps. 希望能有所帮助。

by creating new file whatever in objective c or swift. 通过在目标c或swift中创建新文件。 you can create by attached screenshot 您可以通过附加的屏幕截图创建

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM