macos 有没有办法将 iOS 应用程序转换为 Mac OS X 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4714063/
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
Is there a way to convert an iOS app to a Mac OS X app?
提问by Momi
Is there any way to port an existing iPhone app to a Mac OS X app?
有没有办法将现有的 iPhone 应用程序移植到 Mac OS X 应用程序?
采纳答案by Stephen Darlington
It's a very broad question and, as such, is very difficult to answer.
这是一个非常广泛的问题,因此很难回答。
Generally the answer would have to be no.
一般来说,答案是否定的。
For an app, if you strictly followed the MVC model, you'd be able to keep the model but would need to rewrite both the view and the controller. For a game it depends on how low-level it is. If you used a framework that it also available on the Mac then a lot may port automatically but you'll still need to reconsider the controls, screen size, etc. Either way it's non-trivial.
对于应用程序,如果您严格遵循 MVC 模型,则可以保留模型,但需要重写视图和控制器。对于游戏来说,这取决于它的级别有多低。如果您使用的框架也可在 Mac 上使用,那么很多框架可能会自动移植,但您仍需要重新考虑控件、屏幕大小等。无论哪种方式,这都不是微不足道的。
回答by adib
It's been a while but looks like its now possible to port someiOS app over to the Mac. Obviously they will look as if they are running under the iOS Simulator, without the faux iPhone screen bezel.
已经有一段时间了,但看起来现在可以将一些iOS 应用程序移植到 Mac 上。显然,它们看起来就像是在 iOS 模拟器下运行,没有假 iPhone 屏幕边框。
The framework that makes this possible is UMEKit, a re-implementation of UIKit on the Mac on top of Cocoa.
使这成为可能的框架是UMEKit,它是基于 Cocoa 在 Mac 上重新实现的 UIKit。
回答by Simone D'Amico
I really doubt, iOS programming is view oriented with only one windows, MacOs instead is windows-oriented. Even if the APIs are really similar, the iOS framework is totally a new thing, recently projected (cfr. UITable).
我真的很怀疑,iOS 编程是面向视图的,只有一个窗口,而 MacOs 是面向窗口的。即使 API 真的很相似,iOS 框架也是一个全新的东西,最近预计(参见 UITable)。
回答by radven
A lot of the basic UI elements that iOS apps rely on (such as table views and navigation stacks) are not present on the MacOS. So at the very least you will need to rethink and rewrite a lot of your UI, though a lot of the underlying application logic code can be reused.
iOS 应用程序依赖的许多基本 UI 元素(例如表格视图和导航堆栈)在 MacOS 上不存在。所以至少你需要重新思考和重写你的很多 UI,尽管很多底层应用程序逻辑代码可以重用。