Mac Catalyst

RSS for tag

Start building a native Mac app from your current iPad app using Mac Catalyst.

Mac Catalyst Documentation

Posts under Mac Catalyst tag

111 Posts
Sort by:
Post marked as solved
1 Replies
905 Views
I have a brand new macOS app (built with Mac Catalyst and based on a long existing iOS app) I've submitted to App Store Connect for review. It was rejected due to my Contacts purpose string not being deemed sufficient (despite being the same one the iOS version of the app has been using for years). Anyway, I made a change to the privacy string and submitted a new build. The new build was rejected and a screenshot showed the About screen with the new build number as well as the privacy string from the original build, not the new build. So I verified that my archive did in fact have an Info.plist with the updated privacy string. So I resubmitted that build again for review and it was rejected again for the same reason. Despite the reviewer claiming, at my request, that a fresh install of the latest build was used. So I changed the privacy string again and submitted a 3rd new build, again verifying the archive that I was sending through the Xcode Organizer did have the updated (now 3rd) privacy string. And again the app has been rejected. Despite 2 new builds, the reviewers are still seeing the original privacy string. Does anyone have any ideas on how to get this resolved?
Posted
by
Post not yet marked as solved
0 Replies
577 Views
The delegate method targetIndexPathForMoveOfItemFromOriginalIndexPath is broken on Mac Catalyst. A reproducible is attached below. In a multi-section list using UICollectionLayoutListConfiguration and UICollectionViewDiffableDataSource, I use targetIndexPathForMoveOfItemFromOriginalIndexPath to make sure items can only be drag and drop inside its own section when ordering, but the items can still be dragged into other sections, and the UI will be very strange with the dragged item appearing in its intermediate state. Besides, I found that if reorderingHandlers.didReorder is not set, the delegate method works fine, but I cannot handle didReorder logic, which is useless. To reproduce this issue, simply download the sample code from: https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/implementing_modern_collection_views And apply the attached patch: patch.diff You need to add a Mac Catalyst destination to "Modern Collection Views" target (not the Mac target), and choose "Optimize for Mac" for "Mac Catalyst Interface option". Run the project, select Lists -> Reorderable List, and simply drag any item in section 1 to other sections, and drop, and the issue will reproduce.
Posted
by
Post not yet marked as solved
3 Replies
946 Views
Getting this error several times when presenting a modal window over my splitview window when running it on my Mac using Swift/Mac Catalyst in XCode 14.2. When I click the Cancel button in the window then I get Scene destruction request failed with error: (null) right after an unwind segue. 2023-07-04 16:50:45.488538-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. 2023-07-04 16:50:45.488972-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. 2023-07-04 16:50:45.496702-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. 2023-07-04 16:50:45.496800-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. 2023-07-04 16:50:45.994147-0500 Recipes[27836:1295134] Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7f7fdf068a00>. bleep 2023-07-04 16:51:00.655233-0500 Recipes[27836:1297298] Scene destruction request failed with error: (null) I don't quite understand what all all this means. (The "bleep" was a debugging print code I put in the unwind segue). I'm working through Apple's Mac Catalyst tutorial but it seems to be riddled with bugs and coding issues, even in the final part of the completed app which I dowmloaded and ran. I don't see these problems on IPad simulator. I don't know if it's because Catalyst has problems itself or there's something else going on that I can fix myself. Any insight into these errors would be very much appreciated! PS: The app seems to run ok on Mac without crashing despite the muliple issues
Posted
by
Post not yet marked as solved
1 Replies
794 Views
I have a text based action for iPhone and Mac Catalyst I am developing in Xcode 14.3.1 on macOS 13.4.1. I have the container app, an action and an AppGroup defined. I have confirmed that I can read the necessary shared defaults when the action launches. At this point the UI for the action is a simple textview in which I hope to display a modified version of the text passed to the action in the NSExtensionItems. I am not using a simulator. I am running the action directly using Xcode. What is happening is that the ActionViewController viewDidLoad runs but no visible window opens. In the console I see this as the action launches: 2023-07-05 18:27:23.692277-0700 XYZ[4634:279295] [ViewBridge] ViewBridge attempted to look up a hosted window with identifier 8E816BD5-67D3-402D-ADEB-AC59EDFA1F3B, but it was never registered. 2023-07-05 18:27:23.692408-0700 XYZ[4634:279295] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. .... The last line above is repeated 12 times.... Any helpful ideas would be deeply appreciated! Steve
Posted
by
Post not yet marked as solved
0 Replies
385 Views
macOS 13.5 Beta (22G5038d) Xcode Version 14.2 (14C18) Sample project: https://developer.apple.com/tutorials/mac-catalyst/turning-on-mac-catalyst The app may become unresponsive when dragging the right edge of the window quickly. The stack trace is pasted below.
Posted
by
Post marked as solved
2 Replies
394 Views
macOS Monterey 12.6,MacBook Pro (16-inch, 2019) MacCatalyst App, version support macOS 15 code: let mainWindow = UIWindow.init(windowScene: windowSence) mainWindow.frame = frame // Settings can cause bugs mainWindow.rootViewController = *** Setting the view frame of UIWindow will cause viewDidLayoutSubviews not to be called when UIViewController resizer the edge of the drag window I expect to be able to set the initial size of the window when I open it, if I have any problems with the way I use it, please help provide the appropriate way to call it
Posted
by
Post not yet marked as solved
0 Replies
337 Views
A good while back, I created a Mac Catalyst version of an app. The app uses UICalendarView for both iOS and Mac. I have multiple date selection enabled. In the past, I thought I could select multiple dates on the Mac without needing to use the Command key modifier. And now I can't. Is this a change or am I dreaming? How can I go back to being able to select multiple dates without using the command key modifier?
Posted
by
Post not yet marked as solved
22 Replies
4k Views
In Xcode 15 beta 6, building any Mac Catalyst project will encounter the following Linker warning. ld: warning: building for 'macCatalyst', but linking in dylib (/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa.tbd) built for 'macOS'
Posted
by
Post not yet marked as solved
1 Replies
661 Views
When initializing a CIColor with a dynamic UIColor (like the system colors that resolve differently based on light/dark mode) on macOS 14 (Mac Catalyst), the resulting CIColor is invalid/uninitialized. For instance: po CIColor(color: UIColor.systemGray2) → <uninitialized> po CIColor(color: UIColor.systemGray2.resolvedColor(with: .current)) → <CIColor 0x60000339afd0 (0.388235 0.388235 0.4 1) ExtendedSRGB> But also, not all colors work even when resolved: po CIColor(color: UIColor.systemGray.resolvedColor(with: .current)) → <uninitialized> I think this is caused by the color space of the resulting UIColor: po UIColor.systemGray.resolvedColor(with: .current) → kCGColorSpaceModelRGB 0.596078 0.596078 0.615686 1 po UIColor.systemGray2.resolvedColor(with: .current) → UIExtendedSRGBColorSpace 0.388235 0.388235 0.4 1 This worked correctly before in macOS 13.
Posted
by
Post not yet marked as solved
2 Replies
608 Views
I have an app which uses SwiftUI and Mac Catalyst. When running on a Mac I want to provide a preferences menu entry with the usual keyboard shortcut Command + ,. An implementation via the Settings bundle is out of question since my preferences are too complex for this. Here is a reduced example of my implementation: import SwiftUI @main struct PreferencesMenuTestApp: App { @UIApplicationDelegateAdaptor private var appDelegate: AppDelegate var body: some Scene { WindowGroup { ContentView() } } } class AppDelegate: UIResponder, UIApplicationDelegate { override func buildMenu(with builder: UIMenuBuilder) { let preferencesCommand = UIKeyCommand(title: "Preferences…", action: #selector(showPreferences), input: ",", modifierFlags: .command) // let preferencesCommand = UIAction(title: "Preferences…") { action in // debugPrint("show preferences") // } let menu = UIMenu(title: "Preferences…", options: .displayInline, children: [preferencesCommand]) builder.insertSibling(menu, afterMenu: .about) } @objc func showPreferences() { debugPrint("show preferences") } } The problem is that the menu entry is disabled. Obviously the provided selector is not recognised. When I mark the AppDelegate with @main, then the menu entry is enabled. Of course then the app's window is empty. When I switch to the UIAction implementation (the out commented code) it works fine. But since one cannot provide a keyboard shortcut for UIActions this is not a good solution. What am I missing? How would one implement a preferences menu entry that actually works?
Posted
by
Post not yet marked as solved
0 Replies
711 Views
I've got the following error on Mac Catalyst: TypeError: undefined is not an object (evaluating 'navigator.mediaDevices.getUserMedia') macOS 13.5.1 (22G 90) Safari 17.0 (18616.1.24.11.5, 18616) UserAgent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15" The same app works well on iOS.
Posted
by
Post not yet marked as solved
5 Replies
626 Views
Hello! New to swift development. I've created a very basic iOS app that uses the network extension to block web domains. Now, I am trying to make it work on a macOS using Mac Catalyst. However, when I build the project, I get this error: 2023-09-08 23:31:32.540010+0600 controlShift[69583:2468143] [Metadata] unable to get a dev_t for store 1795162192. 2023-09-08 23:31:33.986014+0600 controlShift[69583:2467453] [] -[NEFilterManager saveToPreferencesWithCompletionHandler:]_block_invoke_3: failed to save the new configuration: (null) The app launches and the UI works correctly. However, it fails to save the preference as stated in the error, so it does not block anything. Here is the relevant part of the code in the root file: var body: some Scene { WindowGroup { ContentView() .environment(\.managedObjectContext, persistenceController.container.viewContext) .onAppear { NEFilterManager.shared().loadFromPreferences { error in if let loadError = error { print("Failed to load the filter configuration: \(loadError)") return } } DispatchQueue.main.asyncAfter(deadline: .now()+1.5) { if NEFilterManager.shared().providerConfiguration == nil { let newConfiguration = NEFilterProviderConfiguration() newConfiguration.username = "UserName" newConfiguration.organization = "myApp " newConfiguration.filterBrowsers = true newConfiguration.filterSockets = true newConfiguration.serverAddress = "http://192.168.100.48:3000" NEFilterManager.shared().providerConfiguration = newConfiguration } NEFilterManager.shared().isEnabled = true NEFilterManager.shared().saveToPreferences { error in if let saveError = error { print("Failed to save the filter configuration: \(saveError)") } } } } } I'm at a loss for what is wrong. Lmk if you need additional details. Thanks! btw, I am very new to swift and iOS/macOS development in general so if there's a better way to write or structure the logic inside the "onAppear" method (of which I'm sure there is), lmk as well. ^_^
Posted
by
Post not yet marked as solved
3 Replies
757 Views
I'm trying to update our Mac version of our iOS app using Xcode 14.2, the update worked using Xcode 11. The detailed error is: Invalid Provisioning Profile. The provisioning profile included in the bundle maccatalyst.com.xxxxxxx.yyyyyyyy [maccatalyst.com.xxxxxxx.yyyyyyyy.pkg/Payload/yyyyyyy.app] is invalid. [Invalid 'com.apple.application-identifier' entitlement value.] For more information, visit the macOS Developer Portal. (ID: 8dd00921-66a8-4eea-b0c5-e674b5073df5) The entitlements are: com.apple.security.files.user-selected.read-write true com.apple.developer.associated-application-identifier YYYYYYYYYY.com.xxxxxxxx.yyyyyyyy com.apple.application-identifier ZZZZZZZZZZ.maccatalyst.com.xxxxxxxx.yyyyyyyyy com.apple.security.network.server true com.apple.security.personal-information.photos-library true com.apple.security.device.bluetooth true get-task-allow false com.apple.security.network.client true com.apple.security.device.camera true com.apple.developer.team-identifier ZZZZZZZZZZ application-identifier ZZZZZZZZZZ.maccatalyst.com.xxxxxxxxxx.yyyyyyyyy com.apple.security.app-sandbox true com.apple.security.personal-information.location true I assume the problem has something to do with the application-identifier having a team identifier prefix (ZZZZZZ...) instead of the developer identifier prefix (YYYYYY...)? How can I fix this? I have seen posts from other people having the same problem but haven't found any solution.
Posted
by
Post not yet marked as solved
2 Replies
470 Views
When I build my app for my real device I get this error /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:10:9 'Foundation/NSURLHandle.h' file not found I have latest macOS (13.5.2 (22G91)) and the latest Xcode (14.3.1 (14E300c)). I got this issue about 5 months now, even on my old Intel mac. My new M1 mac was not restored by a Backup and I still get this issue. Can someone please give me a hint or advice to get this issue fixed?
Posted
by
Post not yet marked as solved
0 Replies
486 Views
When using xcodebuild to build my project, I specify a destination of generic/platform=macOS Xcode informs me that my destination is ambiguous as there is a generic destination for Mac Catalyst. --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, name:Any Mac } { platform:macOS, variant:Mac Catalyst, name:Any Mac } At the end of the day, that's OK. It's selected the proper destination by happenstance. But is there a way t change my destination specifier so that it can zero in on the MacOS destination that is not the MacCatalyst variant? I've tried using "generic/platform=macOS,variant=". But that does not work.
Posted
by
Post not yet marked as solved
0 Replies
235 Views
Hello, I'm currently working on an unreleased iOS app with support for macOS using Mac Catalyst. However, I've encountered an issue while trying to create an archive build for Mac Catalyst using Xcode command line tools. I've set up a new profile specifically for Mac Catalyst and I'm using the Apple Distribution Profile. However, when I attempt to export using this profile, I encounter the following error: "error: exportArchive: No signing certificate 'Mac Installer Distribution' found." I've also tried using a macOS profile, but it results in an error indicating that the profile used is not a Mac Catalyst profile. Upon investigating my Apple Developer Account, I've noticed that when I select macOS, I can see the Mac Distribution option. However, when I choose Mac Catalyst, I only see the Apple Distribution option in the certificate selection. Could you please advise on the correct steps to create a profile and certificate for a Mac Catalyst build? Here's the export info plist and the command I'm using to export the Mac Catalyst app: xcrun xcodebuild -exportArchive \ -archivePath "${ARCHIVE_PATH}" \ -exportOptionsPlist "Path/MacOS_AppStore.plist" \ -exportPath "${DEPLOY_DIR}" Export Options Plist: <dict> <key>method</key> <string>app-store</string> <key>signingStyle</key> <string>manual</string> <key>teamID</key> <string>G28C52EEHV</string> <key>uploadBitcode</key> <true/> <key>uploadSymbols</key> <true/> <key>signingCertificate</key> <string>Apple Distribution</string> <key>provisioningProfiles</key> <dict> <key>com.company.projectName</key> <string>projectName_MacCat_AppStore</string> </dict> </dict> I appreciate any guidance on this matter.
Posted
by
Post not yet marked as solved
0 Replies
348 Views
Hello, I'm trying to build my app for macOS using Mac Catalyst. However, I've encountered an issue while trying to create an archive build for Mac Catalyst using Xcode command line tools. I've set up a new profile specifically for Mac Catalyst and I'm using the Apple Distribution Profile. However, when I attempt to export using this profile, I encounter the following error: "error: exportArchive: No signing certificate 'Mac Installer Distribution' found." I've also tried using a macOS profile, but it results in an error indicating that the profile used is not a Mac Catalyst profile. Upon investigating my Apple Developer Account, I've noticed that when I select macOS, I can see the Mac Distribution option. However, when I choose Mac Catalyst, I only see the Apple Distribution option in the certificate selection. Could you please advise on the correct steps to create a profile and certificate for a Mac Catalyst build? Here's the export info plist and the command I'm using to export the Mac Catalyst app: CLI xcrun xcodebuild -exportArchive -archivePath "${ARCHIVE_PATH}" -exportOptionsPlist "Path/MacOS_AppStore.plist" -exportPath "${DEPLOY_DIR}" Export Options Plist:
Posted
by
Post marked as solved
5 Replies
1.5k Views
I get the following message when I try to run this app in Xcode. Could not launch AppName. Runningboard has returned error 5. Please check the system logs for the underlying cause of the error. Interestingly, the destination Mac (Mac Catalyst) destination does launch. The funny thing is there is a companion app almost exactly like this one that launches fine. Any help with this would be greatly appreciated. Xcode helped me to file a feedback. The number is FB13206919.
Posted
by
Post not yet marked as solved
0 Replies
280 Views
I have a Mac Catalyst app. When using "Live Previews" in Xcode 15 for a view controller of mine the live preview renders at a gigantic size in the Preview. This view controller is only ever presented as a "sheet" on Mac at a fixed size so ideally I'd like to be able to specify the "window size" for the preview environment. Is there a way to do this? Thanks in advance.