Mac Catalyst

RSS for tag

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

Posts under Mac Catalyst tag

200 Posts

Post

Replies

Boosts

Views

Activity

SceneKit Hangs
I experience an issue with SceneKit that is driving me crazy ;( I have severe hangs when I disable Metal API Validation (which is default when you don't run from Xcode). So is there any way to force enable Metal API Validation for AppStore binary? (run MTL_DEBUG_LAYER=1 for Testflight or App Store) Hangs happen on Catalyst but also on iOS if I use lightingEnvironment...
0
0
745
Feb ’24
Encountering Error Domain=NSCocoaErrorDomain Code=513 while creating hard link between files on MacOS(Mac Catalyst App)
Hi, I am trying to create a hard link on MacOS(Mac Catalyst App) between files using [self linkItemAtURL:fromURL toURL:toURL error:&error]; Source Path for MacOS - /var/folders/lf/dt_4nxd945jdry2241phx0_40000gn/T/net.appname.AppName/documents/... Destination Path for MacOS - /Users/username/Library/Group Containers/group.net.appname.AppName.shared/Message/Media/... Although the same code works fine on iOS, but getting following error on MacOS Error Domain=NSCocoaErrorDomain Code=513 couldn’t be linked because you don’t have permission to access, Operation not permitted Source Path for iOS - /Users/user/Library/Developer/CoreSimulator/Devices/B4054540-345F-4D90-A3C5-DA6E6469A3FC/data/Containers/Data/Application/B4AB7D70-491C-49E5-9A3F-27E66EC3423D/tmp/documents/... Destination Path for iOS - /Users/user/Library/Developer/CoreSimulator/Devices/B4054540-345F-4D90-A3C5-DA6E6469A3FC/data/Containers/Shared/AppGroup/842B248E-CCA6-4B5C-82BD-2858EADD3A90/Message/Media/... However, interestingly if I try to copy the file, it works perfectly fine on MacOS as well. I am unable to understand if it is the permission issue, it should not work with copy as well. Does anyone have any reason/solution to this behaviour?
5
0
1.9k
Feb ’24
Unable to inspect web view in iOS app running on Mac
We have an iOS app with a web View. To develop and debug, we inspect the web view using Safari Dev Tools (Developer menu). This Works: We are able to inspect the web view when the application is run on physical devices as well as on simulated devices (iPhone and iPad). This Does NOT Work: We are not able to inspect the web view of the same app running, unmodified, on same Mac. Safari’s Developer menu says “No Inspectable Applications” against the Mac. Requesting guidance or leads on ways to inspect and debug the app under these conditions. Many thanks!
1
0
899
Feb ’24
Mac OS beta(sonoma 14.4) Crash when using CGDisplayCreateImage(_: CGDirectDisplayID, rect: CGRect)
In our mac catalyst app we access AppKit api's by using MacOS bundle(plugin). when using CGDisplayCreateImage(_: CGDirectDisplayID, rect: CGRect) method the plugin crashes. Implementation: @objc func windowMoved(_ notification: NSNotification) { guard let win = self.window else { return } let displayId = CGMainDisplayID() let winRect = win.contentView?.convert(qrRect, from: self) var rect = win.convertToScreen(winRect ?? self.bounds) if let screenFrame = NSScreen.main?.visibleFrame { rect.origin.y = screenFrame.height - rect.maxY rect.origin.y += screenFrame.minY + win.titlebarHeight } guard let image = CGDisplayCreateImage( displayId, rect: rect) else { return } guard let qrString = image.detectQRCode().first else { return } // ... } Crash report in printed in console: -[RPDaemonProxy proxyCoreGraphicsWithMethodType:config:machPort:completionHandler:]: unrecognized selector sent to instance 0x600000500960 ( 0 CoreFoundation 0x00000001931deccc __exceptionPreprocess + 176 1 libobjc.A.dylib 0x0000000192cc6788 objc_exception_throw + 60 2 CoreFoundation 0x000000019329102c -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x0000000193148a80 ___forwarding___ + 976 4 CoreFoundation 0x00000001931485f0 _CF_forwarding_prep_0 + 96 5 ScreenCaptureKit 0x0000000227d9d95c SLSHWCaptureDesktopProxying + 692 6 SkyLight 0x0000000198b370a8 SLSHWCaptureDesktop + 488 7 SkyLight 0x0000000198b3b1ac SLSDisplayCreateImage + 252 8 MacPlugin 0x0000000112e0d374 $s9MacPlugin14MZMacQrScannerC11windowMovedyySo14NSNotificationCF + 1500 9 MacPlugin 0x0000000112e0d714 $s9MacPlugin14MZMacQrScannerC11windowMovedyySo14NSNotificationCFTo + 52 10 CoreFoundation 0x000000019315eb1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 11 CoreFoundation 0x00000001931f2db8 ___CFXRegistrationPost_block_invoke + 88 12 CoreFoundation 0x00000001931f2d00 _CFXRegistrationPost + 440 13 CoreFoundation 0x000000019312d648 _CFXNotificationPost + 768 14 Foundation 0x0000000194249434 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 15 AppKit 0x00000001969ffbfc -[NSWindow _setFrameCommon:display:fromServer:] + 2056 16 AppKit 0x0000000197475080 -[NSWindow _windowMovedToRect:dueToMoveEvent:] + 184 17 AppKit 0x0000000196ae8630 -[NSWindow _windowMoved:] + 832 18 AppKit 0x0000000196ae82a4 -[NSWindow _internalHandleAppKitDefinedEvent:] + 152 19 AppKit 0x0000000196ae8074 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 528 20 AppKit 0x0000000196ae7c90 -[NSWindow(NSEventRouting) sendEvent:] + 284 21 AppKit 0x00000001971adda8 -[NSApplication(NSEventRouting) sendEvent:] + 1800 22 UIKitMacHelper 0x00000001acb964f8 -[NSApplication(UINSApplicationSwizzling) _uinsSwizzledSendEvent:] + 252 23 AppKit 0x0000000196dfb954 -[NSApplication _handleEvent:] + 60 24 AppKit 0x00000001969afd24 -[NSApplication run] + 512 25 AppKit 0x0000000196986fa4 NSApplicationMain + 880 26 AppKit 0x0000000196bd9798 +[NSWindow _savedFrameFromString:] + 0 27 UIKitMacHelper 0x00000001acb82198 UINSApplicationMain + 972 28 UIKitCore 0x00000001c2ea2924 UIApplicationMain + 148 29 MyApp-DEBUG 0x00000001049d2d04 main + 64 30 dyld 0x0000000192d020e0 start + 2360 This is working fine in all previous version but crashing in macOS beta 14.4 and 14.4.1.
0
2
946
Feb ’24
Popover from NSToolbarItem in Mac Catalyst app
Hi, Inside a Mac Catalyst app, I need to display a popover starting from an NSToolbarItem contained inside the app toolbar (like the Apple Maps Mac app does, see below image). In order to do that, when I press the button I need to find the toolbar item view and use it as popover anchor. How can I find the view or frame of an NSToolbarItem on Mac Catalyst? A property that could help me is the NSToolbarItem "view" property (NSView), but that property has been marked has unavailable in Mac Catalyst. Any idea? Thank you
3
3
2.0k
Feb ’24
SFSafariViewController behaves differently in MacCatalyst than iOS
I was loading a URL using SFSafariViewController in my app and also implemented the SFSafariViewControllerDelegate. I noticed that when I am running my app on iOS, I am not getting the callBack in safariViewControllerDidFinish(_:) until or unless "Done" button is pressed. But when I am running it on MacCatalyst following behaviour is noticed: default browser is launched. I get a callback in safariViewControllerDidFinish(_:) without any of my action(like pressing "Done" button). Is this the expected behaviour? I am curious to know why I am getting callback in safariViewControllerDidFinish(_:).
1
0
939
Jan ’24
Catalyst - running macOS exec file using Process returns error
Running a Process executableURL path for a Catalyst target using a macOS type bundle returns the following error as output: (/Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport_macCatalyst.dylib), but incompatible platform (have \'MacCatalyst\', need \'macOS\')) Is it possible to set which dylib platform is used by the macOS bundle executable file instead of using the MacCatalyst one?
0
2
1.1k
Jan ’24
Issue with SwiftUI Alert Freezing in AUv3 Extension Project on Mac Catalyst
Hello, I am working on an AUv3 extension project using SwiftUI in Xcode and have encountered a peculiar issue when implementing a simple alert on Mac Catalyst. The code is straightforward; it's merely an alert triggered by a button within a SwiftUI view. Here's the relevant portion of the code: import SwiftUI struct SwiftAUv3ExtensionMainView: View { var parameterTree: ObservableAUParameterGroup @State var showingAlert = false var body: some View { VStack { ParameterSlider(param: parameterTree.global.gain) Button(action: {showingAlert = true}, label: { Text("Button") }) } .alert("Alert", isPresented: $showingAlert, actions: {}, message: { Text("Message") }) } } The problem arises when this alert is displayed and subsequently closed. Upon closing the alert, the cursor turns into a spinning rainbow and the app freezes for several seconds. Additionally, Xcode's console displays the warning: -[NSWindow makeKeyWindow] called on _NSAlertPanel which returned NO from -[NSWindow canBecomeKeyWindow]. I am looking for insights or solutions to address this issue. Has anyone else experienced similar problems with SwiftUI alerts in AUv3 extension projects, especially when using Mac Catalyst? Any advice or suggestions would be greatly appreciated. Thank you.
0
0
1k
Jan ’24
Crash entering Picture in Picture from webview on Mac Catalyst or Made for iPad
Crash seems to be in a private Apple framework. There's some other reports of this floating around but no solutions so far. Any ideas? *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WebAVPlayerLayer startRedirectingVideoToLayer:forMode:]: unrecognized selector sent to instance 0x6000037033c0' *** First throw call stack: ( 0 CoreFoundation 0x0000000187d56800 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018784deb4 objc_exception_throw + 60 2 CoreFoundation 0x0000000187e083bc -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x0000000187cc0a84 forwarding + 1572 4 CoreFoundation 0x0000000187cc03a0 _CF_forwarding_prep_0 + 96 5 AVKit 0x00000001bdc81f30 -[__AVPlayerLayerView startRoutingVideoToPictureInPicturePlayerLayerView] + 156 6 AVKit 0x00000001bdcf1d48 -[AVPictureInPicturePlatformAdapter(Common) _setRoutingVideoToHostedWindow:pictureInPictureViewController:source:] + 84 7 AVKit 0x00000001bdcd952c -[AVPictureInPicturePlatformAdapter startPictureInPicture] + 380 8 AVKit 0x000000022883000c -[AVPictureInPicturePlatformAdapterAccessibility startPictureInPicture] + 44 9 AVKit 0x00000001bdcddea0 -[AVPictureInPictureController startPictureInPicture] + 216 10 WebCore 0x00000001c75277c8 -[WebAVPlayerViewController startPictureInPicture] + 128 11 libdispatch.dylib 0x0000000102c64f14 _dispatch_call_block_and_release + 32
2
0
1.2k
Dec ’23
How to prevent scene restoration in a catalyst app
Hello all, I'm porting my existing app to catalyst with optimized for mac option. However, I noticed the app will sometimes restore previous open windows if I previously kill it in Xcode. However, these restored windows are also just showing the app entry content instead of restoring the previous scene content. Question, is there anyway to disable this restore scene behavior? Thanks!
1
0
811
Dec ’23
How do I open my app's section of Notification settings in Catalyst?
I have a button in my iOS app that opens the Settings app to my app's Notification permissions section. I use UIApplicationOpenSettingsURLString for this (or UIApplicationOpenNotificationSettingsURLString on iOS 15.4 and later). On Catalyst, both of these simply open the settings screen that is auto-generated from the Settings bundle. How do I get it to open to the appropriate place in System Settings?
2
1
1.2k
Dec ’23
List reordering doesn't work in a popover on Sonoma
List items do not appear to be moveable when they are contained within a popover on Mac Catalyst running on macOS Sonoma. Dragging and dropping a list item simply returns it to its original location, and onMove(preform:) is not called. The same happens using the drag handles with an EditButton() or .environment(\.editMode, .constant(.active)). Below is a reproducible sample which, to my knowledge, worked as expected on Ventura. It also currently works as expected on iPad. Changing the popover to a sheet makes it work on Mac Catalyst, but then, the view takes up a lot of unnecessary space. Does anyone have any good workarounds for this issue? struct ContentView: View { @State private var isShowingPopover = false @State private var items = ["one", "two", "three"] var body: some View { Button("Show Popover") { isShowingPopover = true } .popover(isPresented: $isShowingPopover) { List { ForEach(items, id: \.self) { item in Text(item) } .onMove { fromOffsets, toOffset in items.move(fromOffsets: fromOffsets, toOffset: toOffset) } } .frame(minWidth: 300, minHeight: 270) } } }
1
2
769
Dec ’23
Use prebuilt dylib built for macOS in macCatalyst?
Is there a way to link a prebuilt dylib that was built for the 'macOS' platform on Mac Catalyst without being warned by Xcode? Generally it would be better to just recompile for Mac Catalyst but this is a third party library and they have a complicated build system with dozens of dependencies that doesn't support Mac Catalyst as of now (although they have iOS and Mac 'regular'). So I would have to spend quite a bit of time trying to sort through their build system to make a Catalyst version myself. The library uses no platform specific UI code and I'm fairly certain that macOS build would work just fine on Mac Catalyst without any changes since it isn't UI related at all. It seems to work fine (apart from Xcode warning me about linking a .dylib built for macOS on Mac Catalyst). I could shim all this away in a NSBundle that is aware of the AppKit world but then I have to make all method calls to the third party framework on Mac Catalyst through the bundle and it would separate my iOS and Catalyst code relying on the same implementation which isn't great. Is there a way I could just replace the 'macOS' platform in the .dylib with macCatalyst to get rid of the warning?
2
1
1.6k
Nov ’23
Render Menu Items with Icon (e.g SFSymbol) on Catalyst
Hello, is there a recommended way to render Menu items, e.g in a SwiftUI ContextMenu with icon (SFSymbols)? Let's say I have the following setup: Both buttons render fine on native macOS (e.g Sonoma) but Catalyst refuses to render the symbol at all. I tried every possible combination I could think off. The only way I found was to directly copy and paste a symbol from the SF symbols app and inline it with the label string as unicode. Unfortunately I have a couple custom SF symbols so this isn't really an option for me. I feel like this is a perfectly valid usecase, as it makes the menu visually a lot easier scannable. With UIKit and Ventura this at least worked for Menubar items but now also seems broken on Sonoma. I would greatly appreciate any hints. Thanks!
2
0
2.0k
Nov ’23
Mac Catalyst Menu Bar/Toolbar Actions Not Validating Properly After Changing Active Windows
I have a multiple window Mac Catalyst app. I'm using a NSToolbar and the menu bar via UIMenuBuilder. I noticed after changing windows the menu bar isn't always validating properly. For example my app implements "Undo" and "redo". So I can reproduce the issue using these steps: Perform an action that can be undone. Open a new window. This new window has its own undo manager. In the Menu bar select Edit -> Undo Undo validates even though the current window has nothing on its local undo stack. If invoked undo is performed on the inactive window which definitely seems wrong. The same thing sometimes happens in reverse (that is, undo doesn't validate when it should after switching windows). This also happens with other actions after switching windows. Sometimes I can get the actions to validate by hitting the Tab key to move focus then shift tabbing back, which seems to force proper lookup in the responder chain (but sometimes that doesn't work). It seems that Catalyst is losing track of the real active window/window scene for some reason and is validating actions on the wrong window scene. Anyone experience this and know where I could be going wrong and/or know of a possible workaround? I tried subclassing UIApplication and implementing the methods there (and then forwarding them to the active UIWindowScene). However this doesn't work, the wrong window scene has its activationState set to UISceneActivationStateForegroundActive when the problem occurs.
9
1
2.4k
Nov ’23
Strange vertical alignment in Catalyst navigation bar titles in modal sheets w/Catalyst & macOS Sonoma
Is anyone else running into an issue with navigation bar titles in Catalyst app being shown higher up than normal when presented as a modal sheet under Sonoma (see screenshot)? I tried adjusting the titlePositionAdjustment for the appearance, but this only affects the title and not any buttons that may be in the navigation bar, making them uneven. Any suggestions would be helpful as I'm at my wits end on this one.
2
0
1.3k
Nov ’23
SceneKit Hangs
I experience an issue with SceneKit that is driving me crazy ;( I have severe hangs when I disable Metal API Validation (which is default when you don't run from Xcode). So is there any way to force enable Metal API Validation for AppStore binary? (run MTL_DEBUG_LAYER=1 for Testflight or App Store) Hangs happen on Catalyst but also on iOS if I use lightingEnvironment...
Replies
0
Boosts
0
Views
745
Activity
Feb ’24
Encountering Error Domain=NSCocoaErrorDomain Code=513 while creating hard link between files on MacOS(Mac Catalyst App)
Hi, I am trying to create a hard link on MacOS(Mac Catalyst App) between files using [self linkItemAtURL:fromURL toURL:toURL error:&error]; Source Path for MacOS - /var/folders/lf/dt_4nxd945jdry2241phx0_40000gn/T/net.appname.AppName/documents/... Destination Path for MacOS - /Users/username/Library/Group Containers/group.net.appname.AppName.shared/Message/Media/... Although the same code works fine on iOS, but getting following error on MacOS Error Domain=NSCocoaErrorDomain Code=513 couldn’t be linked because you don’t have permission to access, Operation not permitted Source Path for iOS - /Users/user/Library/Developer/CoreSimulator/Devices/B4054540-345F-4D90-A3C5-DA6E6469A3FC/data/Containers/Data/Application/B4AB7D70-491C-49E5-9A3F-27E66EC3423D/tmp/documents/... Destination Path for iOS - /Users/user/Library/Developer/CoreSimulator/Devices/B4054540-345F-4D90-A3C5-DA6E6469A3FC/data/Containers/Shared/AppGroup/842B248E-CCA6-4B5C-82BD-2858EADD3A90/Message/Media/... However, interestingly if I try to copy the file, it works perfectly fine on MacOS as well. I am unable to understand if it is the permission issue, it should not work with copy as well. Does anyone have any reason/solution to this behaviour?
Replies
5
Boosts
0
Views
1.9k
Activity
Feb ’24
Unable to inspect web view in iOS app running on Mac
We have an iOS app with a web View. To develop and debug, we inspect the web view using Safari Dev Tools (Developer menu). This Works: We are able to inspect the web view when the application is run on physical devices as well as on simulated devices (iPhone and iPad). This Does NOT Work: We are not able to inspect the web view of the same app running, unmodified, on same Mac. Safari’s Developer menu says “No Inspectable Applications” against the Mac. Requesting guidance or leads on ways to inspect and debug the app under these conditions. Many thanks!
Replies
1
Boosts
0
Views
899
Activity
Feb ’24
Mac OS beta(sonoma 14.4) Crash when using CGDisplayCreateImage(_: CGDirectDisplayID, rect: CGRect)
In our mac catalyst app we access AppKit api's by using MacOS bundle(plugin). when using CGDisplayCreateImage(_: CGDirectDisplayID, rect: CGRect) method the plugin crashes. Implementation: @objc func windowMoved(_ notification: NSNotification) { guard let win = self.window else { return } let displayId = CGMainDisplayID() let winRect = win.contentView?.convert(qrRect, from: self) var rect = win.convertToScreen(winRect ?? self.bounds) if let screenFrame = NSScreen.main?.visibleFrame { rect.origin.y = screenFrame.height - rect.maxY rect.origin.y += screenFrame.minY + win.titlebarHeight } guard let image = CGDisplayCreateImage( displayId, rect: rect) else { return } guard let qrString = image.detectQRCode().first else { return } // ... } Crash report in printed in console: -[RPDaemonProxy proxyCoreGraphicsWithMethodType:config:machPort:completionHandler:]: unrecognized selector sent to instance 0x600000500960 ( 0 CoreFoundation 0x00000001931deccc __exceptionPreprocess + 176 1 libobjc.A.dylib 0x0000000192cc6788 objc_exception_throw + 60 2 CoreFoundation 0x000000019329102c -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x0000000193148a80 ___forwarding___ + 976 4 CoreFoundation 0x00000001931485f0 _CF_forwarding_prep_0 + 96 5 ScreenCaptureKit 0x0000000227d9d95c SLSHWCaptureDesktopProxying + 692 6 SkyLight 0x0000000198b370a8 SLSHWCaptureDesktop + 488 7 SkyLight 0x0000000198b3b1ac SLSDisplayCreateImage + 252 8 MacPlugin 0x0000000112e0d374 $s9MacPlugin14MZMacQrScannerC11windowMovedyySo14NSNotificationCF + 1500 9 MacPlugin 0x0000000112e0d714 $s9MacPlugin14MZMacQrScannerC11windowMovedyySo14NSNotificationCFTo + 52 10 CoreFoundation 0x000000019315eb1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 11 CoreFoundation 0x00000001931f2db8 ___CFXRegistrationPost_block_invoke + 88 12 CoreFoundation 0x00000001931f2d00 _CFXRegistrationPost + 440 13 CoreFoundation 0x000000019312d648 _CFXNotificationPost + 768 14 Foundation 0x0000000194249434 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 15 AppKit 0x00000001969ffbfc -[NSWindow _setFrameCommon:display:fromServer:] + 2056 16 AppKit 0x0000000197475080 -[NSWindow _windowMovedToRect:dueToMoveEvent:] + 184 17 AppKit 0x0000000196ae8630 -[NSWindow _windowMoved:] + 832 18 AppKit 0x0000000196ae82a4 -[NSWindow _internalHandleAppKitDefinedEvent:] + 152 19 AppKit 0x0000000196ae8074 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 528 20 AppKit 0x0000000196ae7c90 -[NSWindow(NSEventRouting) sendEvent:] + 284 21 AppKit 0x00000001971adda8 -[NSApplication(NSEventRouting) sendEvent:] + 1800 22 UIKitMacHelper 0x00000001acb964f8 -[NSApplication(UINSApplicationSwizzling) _uinsSwizzledSendEvent:] + 252 23 AppKit 0x0000000196dfb954 -[NSApplication _handleEvent:] + 60 24 AppKit 0x00000001969afd24 -[NSApplication run] + 512 25 AppKit 0x0000000196986fa4 NSApplicationMain + 880 26 AppKit 0x0000000196bd9798 +[NSWindow _savedFrameFromString:] + 0 27 UIKitMacHelper 0x00000001acb82198 UINSApplicationMain + 972 28 UIKitCore 0x00000001c2ea2924 UIApplicationMain + 148 29 MyApp-DEBUG 0x00000001049d2d04 main + 64 30 dyld 0x0000000192d020e0 start + 2360 This is working fine in all previous version but crashing in macOS beta 14.4 and 14.4.1.
Replies
0
Boosts
2
Views
946
Activity
Feb ’24
iPad App running under Mac Catalyst questions.
It appears the app is sandboxed. I need to be able to access the broader file-system and pick a folder/file. Is this possible? Is it possible to invoke the app with a command-line argument? If so, how is it accessed (in code)?
Replies
1
Boosts
0
Views
580
Activity
Feb ’24
Popover from NSToolbarItem in Mac Catalyst app
Hi, Inside a Mac Catalyst app, I need to display a popover starting from an NSToolbarItem contained inside the app toolbar (like the Apple Maps Mac app does, see below image). In order to do that, when I press the button I need to find the toolbar item view and use it as popover anchor. How can I find the view or frame of an NSToolbarItem on Mac Catalyst? A property that could help me is the NSToolbarItem "view" property (NSView), but that property has been marked has unavailable in Mac Catalyst. Any idea? Thank you
Replies
3
Boosts
3
Views
2.0k
Activity
Feb ’24
SFSafariViewController behaves differently in MacCatalyst than iOS
I was loading a URL using SFSafariViewController in my app and also implemented the SFSafariViewControllerDelegate. I noticed that when I am running my app on iOS, I am not getting the callBack in safariViewControllerDidFinish(_:) until or unless "Done" button is pressed. But when I am running it on MacCatalyst following behaviour is noticed: default browser is launched. I get a callback in safariViewControllerDidFinish(_:) without any of my action(like pressing "Done" button). Is this the expected behaviour? I am curious to know why I am getting callback in safariViewControllerDidFinish(_:).
Replies
1
Boosts
0
Views
939
Activity
Jan ’24
Catalyst - running macOS exec file using Process returns error
Running a Process executableURL path for a Catalyst target using a macOS type bundle returns the following error as output: (/Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport_macCatalyst.dylib), but incompatible platform (have \'MacCatalyst\', need \'macOS\')) Is it possible to set which dylib platform is used by the macOS bundle executable file instead of using the MacCatalyst one?
Replies
0
Boosts
2
Views
1.1k
Activity
Jan ’24
Issue with SwiftUI Alert Freezing in AUv3 Extension Project on Mac Catalyst
Hello, I am working on an AUv3 extension project using SwiftUI in Xcode and have encountered a peculiar issue when implementing a simple alert on Mac Catalyst. The code is straightforward; it's merely an alert triggered by a button within a SwiftUI view. Here's the relevant portion of the code: import SwiftUI struct SwiftAUv3ExtensionMainView: View { var parameterTree: ObservableAUParameterGroup @State var showingAlert = false var body: some View { VStack { ParameterSlider(param: parameterTree.global.gain) Button(action: {showingAlert = true}, label: { Text("Button") }) } .alert("Alert", isPresented: $showingAlert, actions: {}, message: { Text("Message") }) } } The problem arises when this alert is displayed and subsequently closed. Upon closing the alert, the cursor turns into a spinning rainbow and the app freezes for several seconds. Additionally, Xcode's console displays the warning: -[NSWindow makeKeyWindow] called on _NSAlertPanel which returned NO from -[NSWindow canBecomeKeyWindow]. I am looking for insights or solutions to address this issue. Has anyone else experienced similar problems with SwiftUI alerts in AUv3 extension projects, especially when using Mac Catalyst? Any advice or suggestions would be greatly appreciated. Thank you.
Replies
0
Boosts
0
Views
1k
Activity
Jan ’24
Add a keyboard Shortcut to a standard Menu Bar Button (SwiftUI Catalyst app)
I am trying to add a keyboard shortcut to an existing standard Menu Bar Button such as "Tile Window to Left of Screen". I've tried the different .command modifiers but could not find a way to get access to the existing ones in order to add a keyboard shortcut. Thanks for your help in advance
Replies
0
Boosts
0
Views
547
Activity
Jan ’24
visionOS crashes Spatial presentations are not permitted from popovers.
Anyone knows about any workarounds for this crash "Spatial presentations are not permitted from popovers."
Replies
1
Boosts
0
Views
959
Activity
Jan ’24
Crash entering Picture in Picture from webview on Mac Catalyst or Made for iPad
Crash seems to be in a private Apple framework. There's some other reports of this floating around but no solutions so far. Any ideas? *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WebAVPlayerLayer startRedirectingVideoToLayer:forMode:]: unrecognized selector sent to instance 0x6000037033c0' *** First throw call stack: ( 0 CoreFoundation 0x0000000187d56800 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018784deb4 objc_exception_throw + 60 2 CoreFoundation 0x0000000187e083bc -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x0000000187cc0a84 forwarding + 1572 4 CoreFoundation 0x0000000187cc03a0 _CF_forwarding_prep_0 + 96 5 AVKit 0x00000001bdc81f30 -[__AVPlayerLayerView startRoutingVideoToPictureInPicturePlayerLayerView] + 156 6 AVKit 0x00000001bdcf1d48 -[AVPictureInPicturePlatformAdapter(Common) _setRoutingVideoToHostedWindow:pictureInPictureViewController:source:] + 84 7 AVKit 0x00000001bdcd952c -[AVPictureInPicturePlatformAdapter startPictureInPicture] + 380 8 AVKit 0x000000022883000c -[AVPictureInPicturePlatformAdapterAccessibility startPictureInPicture] + 44 9 AVKit 0x00000001bdcddea0 -[AVPictureInPictureController startPictureInPicture] + 216 10 WebCore 0x00000001c75277c8 -[WebAVPlayerViewController startPictureInPicture] + 128 11 libdispatch.dylib 0x0000000102c64f14 _dispatch_call_block_and_release + 32
Replies
2
Boosts
0
Views
1.2k
Activity
Dec ’23
How to prevent scene restoration in a catalyst app
Hello all, I'm porting my existing app to catalyst with optimized for mac option. However, I noticed the app will sometimes restore previous open windows if I previously kill it in Xcode. However, these restored windows are also just showing the app entry content instead of restoring the previous scene content. Question, is there anyway to disable this restore scene behavior? Thanks!
Replies
1
Boosts
0
Views
811
Activity
Dec ’23
How do I open my app's section of Notification settings in Catalyst?
I have a button in my iOS app that opens the Settings app to my app's Notification permissions section. I use UIApplicationOpenSettingsURLString for this (or UIApplicationOpenNotificationSettingsURLString on iOS 15.4 and later). On Catalyst, both of these simply open the settings screen that is auto-generated from the Settings bundle. How do I get it to open to the appropriate place in System Settings?
Replies
2
Boosts
1
Views
1.2k
Activity
Dec ’23
List reordering doesn't work in a popover on Sonoma
List items do not appear to be moveable when they are contained within a popover on Mac Catalyst running on macOS Sonoma. Dragging and dropping a list item simply returns it to its original location, and onMove(preform:) is not called. The same happens using the drag handles with an EditButton() or .environment(\.editMode, .constant(.active)). Below is a reproducible sample which, to my knowledge, worked as expected on Ventura. It also currently works as expected on iPad. Changing the popover to a sheet makes it work on Mac Catalyst, but then, the view takes up a lot of unnecessary space. Does anyone have any good workarounds for this issue? struct ContentView: View { @State private var isShowingPopover = false @State private var items = ["one", "two", "three"] var body: some View { Button("Show Popover") { isShowingPopover = true } .popover(isPresented: $isShowingPopover) { List { ForEach(items, id: \.self) { item in Text(item) } .onMove { fromOffsets, toOffset in items.move(fromOffsets: fromOffsets, toOffset: toOffset) } } .frame(minWidth: 300, minHeight: 270) } } }
Replies
1
Boosts
2
Views
769
Activity
Dec ’23
Use prebuilt dylib built for macOS in macCatalyst?
Is there a way to link a prebuilt dylib that was built for the 'macOS' platform on Mac Catalyst without being warned by Xcode? Generally it would be better to just recompile for Mac Catalyst but this is a third party library and they have a complicated build system with dozens of dependencies that doesn't support Mac Catalyst as of now (although they have iOS and Mac 'regular'). So I would have to spend quite a bit of time trying to sort through their build system to make a Catalyst version myself. The library uses no platform specific UI code and I'm fairly certain that macOS build would work just fine on Mac Catalyst without any changes since it isn't UI related at all. It seems to work fine (apart from Xcode warning me about linking a .dylib built for macOS on Mac Catalyst). I could shim all this away in a NSBundle that is aware of the AppKit world but then I have to make all method calls to the third party framework on Mac Catalyst through the bundle and it would separate my iOS and Catalyst code relying on the same implementation which isn't great. Is there a way I could just replace the 'macOS' platform in the .dylib with macCatalyst to get rid of the warning?
Replies
2
Boosts
1
Views
1.6k
Activity
Nov ’23
Render Menu Items with Icon (e.g SFSymbol) on Catalyst
Hello, is there a recommended way to render Menu items, e.g in a SwiftUI ContextMenu with icon (SFSymbols)? Let's say I have the following setup: Both buttons render fine on native macOS (e.g Sonoma) but Catalyst refuses to render the symbol at all. I tried every possible combination I could think off. The only way I found was to directly copy and paste a symbol from the SF symbols app and inline it with the label string as unicode. Unfortunately I have a couple custom SF symbols so this isn't really an option for me. I feel like this is a perfectly valid usecase, as it makes the menu visually a lot easier scannable. With UIKit and Ventura this at least worked for Menubar items but now also seems broken on Sonoma. I would greatly appreciate any hints. Thanks!
Replies
2
Boosts
0
Views
2.0k
Activity
Nov ’23
Mac Catalyst Menu Bar/Toolbar Actions Not Validating Properly After Changing Active Windows
I have a multiple window Mac Catalyst app. I'm using a NSToolbar and the menu bar via UIMenuBuilder. I noticed after changing windows the menu bar isn't always validating properly. For example my app implements "Undo" and "redo". So I can reproduce the issue using these steps: Perform an action that can be undone. Open a new window. This new window has its own undo manager. In the Menu bar select Edit -> Undo Undo validates even though the current window has nothing on its local undo stack. If invoked undo is performed on the inactive window which definitely seems wrong. The same thing sometimes happens in reverse (that is, undo doesn't validate when it should after switching windows). This also happens with other actions after switching windows. Sometimes I can get the actions to validate by hitting the Tab key to move focus then shift tabbing back, which seems to force proper lookup in the responder chain (but sometimes that doesn't work). It seems that Catalyst is losing track of the real active window/window scene for some reason and is validating actions on the wrong window scene. Anyone experience this and know where I could be going wrong and/or know of a possible workaround? I tried subclassing UIApplication and implementing the methods there (and then forwarding them to the active UIWindowScene). However this doesn't work, the wrong window scene has its activationState set to UISceneActivationStateForegroundActive when the problem occurs.
Replies
9
Boosts
1
Views
2.4k
Activity
Nov ’23
Strange vertical alignment in Catalyst navigation bar titles in modal sheets w/Catalyst & macOS Sonoma
Is anyone else running into an issue with navigation bar titles in Catalyst app being shown higher up than normal when presented as a modal sheet under Sonoma (see screenshot)? I tried adjusting the titlePositionAdjustment for the appearance, but this only affects the title and not any buttons that may be in the navigation bar, making them uneven. Any suggestions would be helpful as I'm at my wits end on this one.
Replies
2
Boosts
0
Views
1.3k
Activity
Nov ’23
Should I Remove Mac Catalyst Destination and Add Mac (Designed for iPad) Destination? - Opinions Welcomed
If I do this, I'll only have to submit the iOS version of the app and not have to dork with two app reviews. What do you think? What am I missing?
Replies
2
Boosts
0
Views
1.4k
Activity
Nov ’23