PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 11, 2022

[FIXED] How can I publish an app for both iOS and macOS?

 September 11, 2022     cross-platform, ios, macos, macos-big-sur     No comments   

Issue

I’m working on an iPhone/iPad app exclusively with Objective-C files.

Is there a way to build a Mac app without having to duplicate many of them?

Is there a way I can make custom button files (.h, .m) that work for both iOS and macOS?


Solution

You will need to add it to the platforms

enter image description here

enter image description here

and exclude the codes which wont work on MacOS with :

#if !targetEnvironment(macCatalyst)
// Code to exclude from Mac.
#endif

then you need to optimize your app for MacOs , more details on : https://developer.apple.com/documentation/uikit/mac_catalyst/optimizing_your_ipad_app_for_mac



Answered By - Amir Doreh
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing