使用 Xcode 开发网页

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5428980/
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 20:38:36  来源:igfitidea点击:

Use Xcode for developing web pages

xcodeideeditor

提问by Iqbal Khan

I want to know if I can develop a web page in Xcode.

我想知道我是否可以在Xcode中开发一个网页。

If yes, how?

如果是,如何?

What is the main difference between a normal web page and a web page for an iPhone, iPod, or iPad? Where should I start?

普通网页与 iPhone、iPod 或 iPad 的网页之间的主要区别是什么?我应该从哪里开始?

回答by Kirby Todd

No, use DashCodefor developing iphone web apps. See Mobile Safari Web Application Tutorialfor more info.

不,使用DashCode开发 iphone 网络应用程序。有关详细信息,请参阅移动 Safari Web 应用程序教程

回答by icktoofay

You can indeed write web pages with Xcode. I was able to do so by creating a new empty project, then creating a new file in it with a .htmlextension. Ready to go.

您确实可以使用 Xcode 编写网页。我可以通过创建一个新的空项目,然后在其中创建一个带有.html扩展名的新文件来做到这一点。准备好出发。

There is no real difference between webpages for normal browsers and iOS devices. Webpages for iOS devices may have special metatags changing the viewport and rely on WebKit-specific things, but there's no significantdifference.

普通浏览器和 iOS 设备的网页之间没有真正的区别。iOS 设备的网页可能有特殊的meta标签来改变视口并依赖于特定于 WebKit 的东西,但没有显着差异。

If you already know HTML, you may want to start at http://developer.apple.com/safari.

如果您已经了解 HTML,您可能想从http://developer.apple.com/safari开始。

As for dynamic web pages, yes, of course. Again, it's not that different from developing dynamic web pages for normal browsers.

至于动态网页,当然可以。同样,这与为普通浏览器开发动态网页没有什么不同。

回答by Kevin Sylvestre

Although you can write HTML in Xcode it is really not the best choice. I'd recommend using TextMate, Codaor any of the other thousand text editors available. Alternatively, Dashcode is available and is specifically designed for targeting mobile devices.

尽管您可以在 Xcode 中编写 HTML,但它确实不是最佳选择。我建议使用TextMateCoda或其他一千个可用的文本编辑器中的任何一个。或者,可以使用 Dashcode,它是专门为定位移动设备而设计的。

Furthermore, if you want to generate dynamic webpages, you are going to need to start using a server side language such as PHP, Java, Ruby, Python, etc. Mac OS X comes with Apache and PHP installed so if it is something trivial this might be your best option.

此外,如果您想生成动态网页,您将需要开始使用服务器端语言,例如 PHP、Java、Ruby、Python 等。Mac OS X 附带安装了 Apache 和 PHP,所以如果它是微不足道的可能是你最好的选择。

回答by Fabio Ricci

In my opinion, yes you can use Xcode for web development.

在我看来,是的,您可以使用 Xcode 进行 Web 开发。

And while Xcode does not target to the web development as other software (like Brackets, DW, etc.) it has a nice feature: a drop-down menu of javascript functions, which would be extremely useful to have in other web development IDEs...

虽然 Xcode 不像其他软件(如 Brackets、DW 等)那样面向 Web 开发,但它有一个很好的功能:javascript 函数的下拉菜单,这在其他 Web 开发 IDE 中非常有用。 ..

回答by pkamb

I'm an iOS and Mac developer. I use Xcode all day with Swift and Objective-C.

我是一名 iOS 和 Mac 开发人员。我一整天都在使用 Xcode 和 Swift 和 Objective-C。

I recently had the need to work on a small website project. This isn't what I normally do.

我最近需要处理一个小型网站项目。这不是我通常做的。

I use TextMate as my single-file text editor, alongside Xcode. But I found the app veryannoying for working in a web projectwith multiple files. There's probably a way that the pros set up their editors for working in a project, but it's beyond me at the moment.

我将 TextMate 与 Xcode 一起用作我的单文件文本编辑器。但是我发现该应用程序在处理具有多个文件的 Web项目非常烦人。专业人士可能有一种方法来设置他们的编辑器以在项目中工作,但目前这超出了我的范围。

I ended up creating a new Xcode Workspacethen adding my web files to the sidebar. A workspaceis very lightweight and does not contain any of the iOS cruft from a new Xcode project.

我最终创建了一个新的 Xcode 工作区,然后将我的 Web 文件添加到侧边栏。一个工作空间是非常轻便,不包含一个新的Xcode项目的任何iOS的克鲁夫特的。

This lets me use my standard Xcode project searching, keyboard shortcuts, behaviors, etc. I'm not using any serious "web" features, but at least the basics are the same as the IDE I'm accustomed to for mobile development.

这让我可以使用我的标准 Xcode 项目搜索、键盘快捷键、行为等。我没有使用任何严重的“网络”功能,但至少基础知识与我习惯于移动开发的 IDE 相同。

So the answer is yes, Xcode can be used as a web IDE.

所以答案是肯定的,Xcode 可以用作 web IDE

It's probably not the best web IDE, and it's probably lacking a lot of the features and conveniences that professional web developers rely on. But it works in a pinch, especially for mobile developers who are already accustomed to Xcode.

它可能不是最好的 Web IDE,而且它可能缺乏专业 Web 开发人员所依赖的许多功能和便利。但它在紧要关头工作,特别是对于已经习惯了 Xcode 的移动开发人员。

Xcode IDE for web project

用于 Web 项目的 Xcode IDE