Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3781570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:57:38+00:00 2026-05-19T10:57:38+00:00

I have an iOS app that I am rewriting to work on both Mac

  • 0

I have an iOS app that I am rewriting to work on both Mac and iOS. I have my views working reasonably well, but everything is static at the moment.

What do I typically do with my view controller code? In the iOS-only app, it is typically a bunch of stuff that says things like “if the user touches here, do that.”

I’ve found the hitTest: method. So I’m pretty sure I can write everything so it works. I guess my question is more organizational. Ideally, I would want to set things up so that the code that is currently in UIViewController subclasses would work on both platforms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:57:38+00:00Added an answer on May 19, 2026 at 10:57 am

    You won’t be able to make the UIViewController code work on both platforms. The Mac doesn’t have UIKit, and iPhone doesn’t have AppKit.

    What you really want to do at this point is have all of your networking, math and logic code in external classes. Normally subclasses of NSObject. Then, all you have to do is write code that calls these classes within your view controllers.

    You’re going to face one further challenge though – I don’t think that you can have an app run on iPhone and Mac from one Bundle. When you compile your app, you normally compile to a specific processor. The Mac runs on Intel/PowerPC, and iPhone runs on Arm. You’re going to have to fiddle with build targets etc. endlessly.

    I would suggest maintaining two separate projects, and putting the aforementioned logic classes in a shared location and making sure that when you import them you don’t choose the ‘Copy to group destination folder’ option. This way, any edits you make to the iPhone version of the code carries accross to the Mac version and vice-versa.

    Happy coding,

    Zane

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a Core Data iOS app that works perfectly through
I have an ios app that has alot of static content and static settings.
Is it possible to have an iOS app that's not ARC enabled but with
I have an ios app that has a target of both iphone and ipad.
I have developed an iOS app that uses CoreData/SQLite. It works, but now I
I have an iOS app that streams background audio using AVAudioSession. It is working
I am working on a simple iOS app that I have taken over at
I have a Rails app that has 2 clients -- an iOS app reads/writes
I have an app on my iPhone that was built on iOS 5 and
I have an iOS app and I want to make it accessible. Everything goes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.