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
9
votes
0 answers

Mac Catalyst: AVAudioSession.availableInputs returns no inputs

I am trying to port audio input to Mac Catalyst. As of now I am using xcode13GM, macOS 10.15 Beta 8 (19A558d), ios13beta8. The following code does not return any input ports. let audioSession = AVAudioSession.sharedInstance() try…
Chris
  • 1,231
  • 2
  • 10
  • 20
9
votes
3 answers

How to get trackpad / mouse wheel scrolling events in MacOS Catalyst app?

We built our iPad app for MacOS using Catalyst and I cannot figure out how to get two-finger trackpad scrolling gestures to work in a custom UIView. The standard UIKit components (e.g., UITableView) scroll with the standard two-finger trackpad…
LenK
  • 2,944
  • 2
  • 20
  • 26
9
votes
2 answers

buildMenu is called in AppDelegate but not UIViewController

I'm attempting to create a custom menu for each view in my app, however it appears buildMenu is not being called in View Controllers. Here's an example: In my AppDelegate, this code is used, which works 100% as expected. override func buildMenu(with…
Dave
  • 91
  • 1
  • 3
8
votes
1 answer

Change prompt color for UITextField or UITextView on Mac Catalyst

How can I programmatically change the color of the prompt on mac catalyst for an UITextField? The prompt exist but with the same color as UITextField. The prompt is showing the right color on iOS. I unsuccessfully tried .tintColor Code + iOS and Mac…
8
votes
1 answer

Catalyst - Opening context menu programmatically

I'm using a context menu in my catalyst app by using let interaction = UIContextMenuInteraction(delegate: self) editButton.addInteraction(interaction) This works fine on Mac and menu is opened when user clicked by using right mouse button. On the…
emreoktem
  • 2,409
  • 20
  • 36
8
votes
2 answers

macCatalyst/ SwiftUI Touch Bar

how could I add Touch Bar Support in Catalyst- Apps written in SwiftUI? For Example, if I want to display a Button in a View: import SwiftUI struct ContentView: View { var body: some View { VStack{ #if…
TS251
  • 353
  • 4
  • 10
8
votes
0 answers

UISearchController/UISearchBar behaves differently under macOS than iOS

I have a standard UISearchController with a standard UISearchBar. The search bar is shown in the navigation bar. Everything works as expected on iOS/iPadOS. But the search bar behaves differently under macOS. Under iOS, when you tap on the search…
rmaddy
  • 314,917
  • 42
  • 532
  • 579
8
votes
3 answers

How to get a search bar into an NSToolbar in a Catalyst app?

I've seen some Catalyst apps add a search bar to the NSToolbar and was wondering how I could do the same. Would I have to import AppKit/Cocoa to get an NSSearchField and the actual NSToolbar? Or is there some way with UISearchBars that I am just not…
8
votes
2 answers

UIDatePicker Not working In Mac Catalyst (Xcode 11 Beta 5)

We are converting our iOS app to Mac Catalyst compatible using Swift in Xcode 11 beta 5. We have facing issue that default DatePicker not shown in window. I am trying this solution for mac and it will add date picker in view but I want another…
Hardik Thakkar
  • 15,269
  • 2
  • 94
  • 81
8
votes
0 answers

Xcode 11b4: Directory not found for option .../lib/swift/undefined

When building my project for iOS only, everything's fine. When adding the Mac option, there is a strange warning: ld: warning: directory not found for option…
Hardy
  • 4,344
  • 3
  • 17
  • 27
8
votes
3 answers

Using `xcodebuild` to do a command line builds for Catalyst/UIKit for Mac?

I cannot see this documented anywhere — has anyine figured our how to use xcodebuild to build a propject for UIKIt for Mac (i.e. Catalyst)? You can specify "-sdk iphoneos" vs "-sdk iphonesimulator" to toggle between those two targets, but "-sdk…
marc hoffman
  • 586
  • 1
  • 5
  • 14
7
votes
0 answers

Tap Outside to Dismiss Modally Presented View in Mac Catalyst

I'm presenting a modal view controller in my Mac Catalyst / iOS app. iOS has the ability to swipe the modally presented view down to dismiss, or simply tap outside the presented view. It would appear that mac catalyst has neither of these features.…
Alex Ritter
  • 1,009
  • 3
  • 18
  • 40
7
votes
0 answers

SIGABRT "The following Metal object is being destroyed while still required to be alive by the command buffer" in macCatalyst randomly

I have macCatalyst app that recently gets some random crashes. Searched everywhere but without finding any good leads. My guess is that it's related to memory or too many views visible on the screen. I do not get a good stack trace, but this it…
Sunkas
  • 9,542
  • 6
  • 62
  • 102
7
votes
1 answer

SwiftUI - unexpected behaviour using onTapGesture with mouse/trackpad on iPadOS and Catalyst

I have in my app a layout showing a list of rectangular cards - each one should be tappable (once) to reveal a set of action buttons and more information, etc. I have implemented this using .onTapGesture() and I have also put…
themathsrobot
  • 581
  • 6
  • 20
7
votes
1 answer

PersistentRef of keychain item on macOS catalyst

Background I'm trying to build an app that connects to VPN using native IKEv2 implementation. The app should be built for iOS but run on macOS as well by using Catalyst platform. Situation When connecting to VPN using native IKEv2 implementation in…
hockeyman
  • 1,141
  • 6
  • 27
  • 57
1 2
3
35 36