Questions tagged [mac-catalyst]

An environment and build target for compiling iOS apps to macOS.

Mac Catalyst (previously referred to as and, unofficially, Marzipan) is an environment and build target used to compile an iPadOS app to a macOS app. This is different from running iOS apps on macs with the M1 chip (Apple Silicon macs), which is a more recent development and the iOS apps can run directly on M1 macs without porting.

As of November 2019, it can only port iPad apps. It automates the addition of desktop and windowing features needed by the desktop version of macOS. For example, tab bars on the iPad are automatically converted to toolbar segments on the Mac.

Catalyst is officially supported by Xcode 11 and macOS 10.15 and higher. With Xcode 12, it can port iPhone apps to MacOS as well.

Apple documentation is available here.


Getting Started with Catalyst

Theoretically things should be as simple as checking the "Mac" target in your iPad-compatible app target. However, some extra work usually needs to be done in order to successfully port an app.

One good way to start differentiating your iPad code-base is through the use of a Catalyst compile-time check:

#if targetEnvironment(macCatalyst)
  // Code for catalyst
#endif
538 questions
6
votes
0 answers

Mac Catalyst UICollectionViewCompositionalLayout error

I have the following UICollectionViewCompositionalLayout: public lazy var layout: UICollectionViewLayout = { let layout = UICollectionViewCompositionalLayout { (sectionIndex: Int, layoutEnvironment: NSCollectionLayoutEnvironment) ->…
user4992124
  • 1,574
  • 1
  • 17
  • 35
6
votes
2 answers

Xcode 11 not recognizing static library's architecture: MacCatalyst (aka UIKitForMac)

After getting excited about 2019's WWDC announcements, I tried compiling my existing iOS app against the MacOS using Xcode 11.0 beta. Unfortunately, it didn't go as expected. Xcode says my static library is built for < unknown >…
marcelosalloum
  • 3,481
  • 4
  • 39
  • 63
5
votes
2 answers

SwiftUI & Mac Catalyst | Adding buttons to trailing navigation bar

I have a Mac Catalyst app I had built using SwiftUI,and I cant seem to add buttons to the trailing navigation bar? I am also unsure where this navigationBar is defined, is it possible to remove? It only seems to have appeared in Ventura. struct…
RileyDev
  • 2,950
  • 3
  • 26
  • 61
5
votes
1 answer

How to use .quickLookPreview modifier in swiftui

I am trying to use the view modifier .quickLookPreview introduced in iOS 14, macOS 11 macCatalyst 14 but I get this error Value of type 'some View' has no member 'quickLookPreview' every time I try to use the modifier on a macOS or mac catalyst…
Heyman
  • 449
  • 4
  • 13
5
votes
1 answer

UIActivityViewController completionWithItemsHandler function not called in MacOS app

Background The function shareImage() in the code below launches the UIActivityViewController and shares an image, for example sends to Messages or saves to Photos. After the image is shared, UIActivityViewController finishes up, and calls the…
user4806509
  • 2,925
  • 5
  • 37
  • 72
5
votes
1 answer

Bundle Missing Provisioning Profile in Xcode upload to App Store/Testflight

I have been able to upload the iOS version of my app to the App Store. But when I tried uploading the MacOS version (Catalyst) I keep getting an error WARNING ITMS-90889: ""Cannot be used with TestFlight because the bundle at “TradeFlags.app” is…
AndiAna
  • 854
  • 6
  • 26
5
votes
0 answers

Gesture to dismiss `.sheet` on Mac Catalyst

The behavior I am getting when using the .sheet modifier on SwiftUI is that the displayed sheet cannot be dismissed using swipe down gesture on a Mac (Catalyst) which is expected because ... Mac doesn't come with a touchscreen. This leads to having…
An Hoa
  • 1,207
  • 12
  • 38
5
votes
1 answer

Swift - App Store Connect Version can't detect Catalyst Environment

I've developed an iOS App and want to bring it to macOS with Catalyst. Everything works out fine, I could optimise the layout for the mac by using following code: extension UIDevice { var type: DeviceType { #if…
5
votes
4 answers

Mac Catalyst - Adding Click + Drag gesture to UITableView/UIScrollView

I am in the process of enabling Catalyst support for a freelancing project — one of the things that I noticed right away is the differing behaviour of scrolling views on MacOS vs iOS. I expected to be able to click and drag UIScrollViews or…
chmod
  • 1,173
  • 1
  • 9
  • 17
5
votes
0 answers

Drag & drop not working on macOS, but does on iOS (using Catalyst)

Drag & drop using onDrag and onDrop from SwiftUI work really well on iOS devices. However, for macOS, I can't even drag a view at all. For iOS it works, for macOS it doesn't, which seems very strange. This app was made with Catalyst, with an iOS…
George
  • 25,988
  • 10
  • 79
  • 133
5
votes
1 answer

Mac Catalyst: multi-window without supporting multi-window in iPad app?

I'm writing a card game app for iPad and want to bring it to the Mac using Catalyst. The game is not one where supporting multiple windows makes a lot of sense. However, there is a statistics screen that I show in a modal form sheet on iPad, which I…
UberJason
  • 3,063
  • 2
  • 25
  • 50
5
votes
1 answer

How do I listen to key presses in a Mac Catalyst app?

I have a simple iOS game that I am porting to Mac. I would like for the user to be able to control the game using their keyboard. There is not native text input (like UITextField, UITextView). How do I listen to key down events in a Mac Catalyst…
Erik
  • 2,138
  • 18
  • 18
5
votes
2 answers

System grouped background color on Mac Catalyst is incorrect for Light Mode

I'm trying to recreate the same look and feel like the settings app on iOS in a Catalyst App. I got a SplitViewController with a TableViewController set up as Grouped as Master and a TableViewController set up as Inset Grouped as Detail. For the…
Robert Veringa
  • 530
  • 4
  • 18
5
votes
2 answers

ERROR ITMS-90283 with "Invalid 'com.apple.application-identifier' entitlement value" when submitting Mac Catalyst app

I'm trying to submit a Mac Catalyst app for the first time, but the upload keeps failing with this error message: ERROR ITMS-90283: "Invalid Provisioning Profile. The provisioning profile included in the bundle…
arlomedia
  • 8,534
  • 5
  • 60
  • 108
5
votes
2 answers

UIDocumentPickerViewController not calling didPickDocumentAtURL on Mac Catalyst

I have this code in a UIViewController that confirms to UIDocumentPickerDelegate: - (void)openTextFilePicker { NSArray *UTIs = [NSArray arrayWithObjects:@"public.text", nil]; [self openFilePicker:UTIs]; } - (void)openFilePicker:(NSArray…
arlomedia
  • 8,534
  • 5
  • 60
  • 108