简体   繁体   English

我们可以将xcode项目(xcodeproj)转换为Swift Playground(.playground)格式吗?

[英]Can we convert xcode project (xcodeproj) to swift playground (.playground) format?

I develop an ios app in xcode, I want to run this app in swift playground. 我用xcode开发了一个ios应用,我想在swift操场上运行这个应用。 so i want to convert my .xcodeproj project in .playground format. 所以我想将我的.xcodeproj项目转换成.playground格式。 so any solution? 有什么办法吗?

You can't really convert your .xcodeproj file to a .playground file but you can add a .playground file to your .xcodeproj file and use it from there 您无法真正将.xcodeproj文件转换为.playground文件,但可以将.playground文件添加到.xcodeproj文件并从那里使用

Open up your .xcodeproj file and follow the steps below to add a .playground file to your project. 打开您的.xcodeproj文件,然后按照以下步骤将.playground文件添加到您的项目中。

  1. Go to File > Save as Workspace Save the Workspace file in the same directory as the .xcodeproj file 转到“ File > Save as Workspace将工作区文件与.xcodeproj文件保存在同一目录中

  2. Create a new .playground file under Source Source下创建一个新的.playground文件

  3. Go to File > New > Target . 转到File > New > Target Next go to iOS > Framework & Library > Cocoa Touch Framework 接下来转到iOS > Framework & Library > Cocoa Touch Framework

  4. Add any files that you want to access from the .playground to the target membership of the Framework we created earlier. 将您要从.playground访问的所有文件添加到我们先前创建的Framework的目标成员资格中。

  5. Select your framework and iOS device from the build sources and Build the project 从构建源中选择您的框架和iOS设备并构建项目

  6. Import your framework to the .playground file 将框架导入到.playground文件

That's All :) 就这样 :)

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

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