11

I'm working on a game that I'd like to ultimately be available for Mac OS X and iOS. What's the best way to do this? Should I (1) focus on one OS first and get a polished version 1.0, then port to the other OS, or (2) should I try to develop for both simultaneously from the start?

If (1), which OS should I target first, i.e. which porting direction is the easiest?

If (2), do I need a separate project in XCode for each OS? If so, how do I maintain just one copy of the platform agnostic code that I share between both projects?

Colin
  • 10,447
  • 11
  • 46
  • 54
  • possible duplicate of [port an iOS (iPhone) app to mac?](http://stackoverflow.com/questions/4579849/port-an-ios-iphone-app-to-mac) – PengOne Jun 28 '11 at 18:50
  • possible duplicate of [Is there a way to convert an iOS app to a Mac OS X app?](http://stackoverflow.com/questions/4714063/is-there-a-way-to-convert-an-ios-app-to-a-mac-os-x-app) – PengOne Jun 28 '11 at 18:51
  • 5
    The question is not about how to port, but how to organize the code. – Eiko Jun 28 '11 at 18:58
  • Have you considered using a game maker specifically setup for this purpose. i.e. something like Unity3d? – Andrew Jun 29 '11 at 04:04

1 Answers1

15

I usually code in parallel, sometimes starting on Mac, sometimes on iOS. Most of the core functions (i.e. non-GUI) is virtually the same on both platforms, but sometimes some of the functionality is missing on one part. Then I try to start off with the poorer platform so that the code will run on both.

Working in parallel gives another benefit: you need to think about good abstraction or you will get annoyed of duplicated code rather quickly. Multiple targets really help with good structure.

As for the multiple targets - yes, in theory this works in Xcode. It was a real pain (with losing references over and over) as soon as I put my "core code" in static libs and keeping everything updating automatically.

My setup is as follows:

MainWorkspace
   CoreFunctionsMacLibProject
   CoreFunctionsIOSLibProject
   TheApplicationMacProject
   TheApplicationIOSProject

The shared code for the core part is in a shared folder, updates are easy given everything is in the same workspace. It would work easily without the separate libraries, I just happen to use them in different projects/workspaces as well.

So far everything goes smooth. Talking about 2-4 libs and several app projects. Just my experience, though. Workspaces make this approach pretty flexible, as you might put a project in more than one workspace.

Eiko
  • 25,601
  • 15
  • 56
  • 71
  • Hi, can you share some links or maybe sample code with examples? My problem that I already have stable ios app and want to develop os x version in parallel but I want to share some classes like 'ApiManager' or 'DataManager' between two versions because the logic is the same. Can you help me please? – Alexander Yakovlev Nov 28 '14 at 13:50