Mac Catalyst

RSS for tag

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

Posts under Mac Catalyst tag

112 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

WKWebView UIDelegate Methods Not Being Called on Mac Catalyst (WKUIDelegate)
I have a WKWebView that sets the UIDelegate: self.webView.UIDelegate = self; The following methods are never called when I right click in the WKWebView to being up a context menu: -(void)webView:(WKWebView*)webView contextMenuForElement:(WKContextMenuElementInfo*)elementInfo willCommitWithAnimator:(id <UIContextMenuInteractionCommitAnimating>)animator -(void)webView:(WKWebView*)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo*)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler - (void)webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo; This is from a Mac Catalyst app (I'm on macOS 14.0 23A344)
4
0
542
Oct ’23
Promo Codes for Mac Catalyst Apps
I have looked high and low all and cannot find an answer or solution. I have an app that is primarily used by Mac users. I am looking to implement promo codes in the coming weeks. The presentCodeRedemptionSheet call does not work for Mac Catalyst apps saying "This function doesn’t affect Mac apps built with Mac Catalyst" in the documentation. AppStore.presentOfferCodeRedeemSheet also does not work for Mac Catalyst. If it is the case that you can't redeem in-app, that is fine if I can direct users to the Mac App Store to redeem promo codes, but I cannot find a way to do that either. I can only find a route to redeem gift cards. I have also tried clicking on a specific promo code link (something like https://apps.apple.com/redeem?ctx=offercodes&id=00000000&code=PROMOCODE) and that just redirects to the Gift Card redemption screen in the Mac App Store. So is there any way for a Mac only user (a user that does not have an iPhone or iPad) to use app promo codes? Thanks!
1
0
609
Oct ’23
Swift Package Plugin Context Tool Path is bugged when building for Mac Catalyst
I have a Swift Package Build Tool Plugin to generate localizations and design tokens, which looks like this currently. // Copyright © 2023 MEGA Limited. All rights reserved. import PackagePlugin @main struct GenerateTokenBuildTool: BuildToolPlugin { func createBuildCommands(context: PluginContext, target: Target) async throws -> [Command] { guard let target = target as? SourceModuleTarget else { return [] } return try target.sourceFiles(withSuffix: "xcassets").map { assetCatalog in let base = assetCatalog.path.stem let input = assetCatalog.path let output = context.pluginWorkDirectory.appending(["\(base).swift"]) // Use this when archiving for MacCatalyst let tool = try context.tool(named: "AssetTokenGenerator").path let toolName = tool.lastComponent let path = tool.removingLastComponent() let macPath = path.removingLastComponent().appending(subpath: path.lastComponent + "-maccatalyst") let executable = macPath.appending(subpath: toolName) // // Use this when archiving for iOS/iPadOS // let executable = try context.tool(named: "AssetTokenGenerator").path return .buildCommand( displayName: "Generating tokens for \(base).xcassets", executable: executable, arguments: [input.string, output.string], inputFiles: [input], outputFiles: [output] ) } } } If you notice, I need to do a bit of manual bug fixing when determining the path of my executable. When building for Mac Catalyst, context.tool(named:).path is pointing to an incorrect folder, thus failing the build for my project with this error: Command PhaseScriptExecution failed with a nonzero exit code sandbox-exec: execvp() of '//Users/mega-jfe/Library/Developer/Xcode/DerivedData/MEGAVPN-efdcwfcaosxfvneqjuvhrvdmbkax/Build/Products/Debug/AssetTokenGenerator' failed: No such file or directory It's suppposed to be using the Debug-maccatalyst folder, but Xcode is pointing the path to Debug. I feel like this is a bug, or else please let me know how I can handle this so that I can build for both without manually changing the code when building for Catalyst. Thanks!
0
0
461
Oct ’23
Make basic content filter work on Mac Catalyst
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. ^_^
5
0
648
Oct ’23
How do I work around a Mac Catalyst framework bug where no Core Animation output is shown in an export session?
This is verified to be a framework bug (occurs on Mac Catalyst but not iOS or iPadOS), and it seems the culprit is AVVideoCompositionCoreAnimationTool? /// Exports a video with the target animating. func exportVideo() { let destinationURL = createExportFileURL(from: Date()) guard let videoURL = Bundle.main.url(forResource: "black_video", withExtension: "mp4") else { delegate?.exporterDidFailExporting(exporter: self) print("Can't find video") return } // Initialize the video asset let asset = AVURLAsset(url: videoURL, options: [AVURLAssetPreferPreciseDurationAndTimingKey: true]) guard let assetVideoTrack: AVAssetTrack = asset.tracks(withMediaType: AVMediaType.video).first, let assetAudioTrack: AVAssetTrack = asset.tracks(withMediaType: AVMediaType.audio).first else { return } let composition = AVMutableComposition() guard let videoCompTrack = composition.addMutableTrack(withMediaType: AVMediaType.video, preferredTrackID: Int32(kCMPersistentTrackID_Invalid)), let audioCompTrack = composition.addMutableTrack(withMediaType: AVMediaType.audio, preferredTrackID: Int32(kCMPersistentTrackID_Invalid)) else { return } videoCompTrack.preferredTransform = assetVideoTrack.preferredTransform // Get the duration let videoDuration = asset.duration.seconds // Get the video rect let videoSize = assetVideoTrack.naturalSize.applying(assetVideoTrack.preferredTransform) let videoRect = CGRect(origin: .zero, size: videoSize) // Initialize the target layers and animations animationLayers = TargetView.initTargetViewAndAnimations(atPoint: CGPoint(x: videoRect.midX, y: videoRect.midY), atSecondsIntoVideo: 2, videoRect: videoRect) // Set the playback speed let duration = CMTime(seconds: videoDuration, preferredTimescale: CMTimeScale(600)) let appliedRange = CMTimeRange(start: .zero, end: duration) videoCompTrack.scaleTimeRange(appliedRange, toDuration: duration) audioCompTrack.scaleTimeRange(appliedRange, toDuration: duration) // Create the video layer. let videolayer = CALayer() videolayer.frame = CGRect(origin: .zero, size: videoSize) // Create the parent layer. let parentlayer = CALayer() parentlayer.frame = CGRect(origin: .zero, size: videoSize) parentlayer.addSublayer(videolayer) let times = timesForEvent(startTime: 0.1, endTime: duration.seconds - 0.01) let timeRangeForCurrentSlice = times.timeRange // Insert the relevant video track segment do { try videoCompTrack.insertTimeRange(timeRangeForCurrentSlice, of: assetVideoTrack, at: .zero) try audioCompTrack.insertTimeRange(timeRangeForCurrentSlice, of: assetAudioTrack, at: .zero) } catch let compError { print("TrimVideo: error during composition: \(compError)") delegate?.exporterDidFailExporting(exporter: self) return } // Add all the non-nil animation layers to be exported. for layer in animationLayers.compactMap({ $0 }) { parentlayer.addSublayer(layer) } // Configure the layer composition. let layerComposition = AVMutableVideoComposition() layerComposition.frameDuration = CMTimeMake(value: 1, timescale: 30) layerComposition.renderSize = videoSize layerComposition.animationTool = AVVideoCompositionCoreAnimationTool( postProcessingAsVideoLayer: videolayer, in: parentlayer) let instructions = initVideoCompositionInstructions( videoCompositionTrack: videoCompTrack, assetVideoTrack: assetVideoTrack) layerComposition.instructions = instructions // Creates the export session and exports the video asynchronously. guard let exportSession = initExportSession( composition: composition, destinationURL: destinationURL, layerComposition: layerComposition) else { delegate?.exporterDidFailExporting(exporter: self) return } // Execute the exporting exportSession.exportAsynchronously(completionHandler: { if let error = exportSession.error { print("Export error: \(error), \(error.localizedDescription)") } self.delegate?.exporterDidFinishExporting(exporter: self, with: destinationURL) }) } Not sure how to implement a custom compositor that performs the same animations as this reproducible case: class AnimationCreator: NSObject { // MARK: - Target Animations /// Creates the target animations. static func addAnimationsToTargetView(_ targetView: TargetView, startTime: Double) { // Add the appearance animation AnimationCreator.addAppearanceAnimation(on: targetView, defaultBeginTime: AVCoreAnimationBeginTimeAtZero, startTime: startTime) // Add the pulse animation. AnimationCreator.addTargetPulseAnimation(on: targetView, defaultBeginTime: AVCoreAnimationBeginTimeAtZero, startTime: startTime) } /// Adds the appearance animation to the target private static func addAppearanceAnimation(on targetView: TargetView, defaultBeginTime: Double = 0, startTime: Double = 0) { // Starts the target transparent and then turns it opaque at the specified time targetView.targetImageView.layer.opacity = 0 let appear = CABasicAnimation(keyPath: "opacity") appear.duration = .greatestFiniteMagnitude // stay on screen forever appear.fromValue = 1.0 // Opaque appear.toValue = 1.0 // Opaque appear.beginTime = defaultBeginTime + startTime targetView.targetImageView.layer.add(appear, forKey: "appear") } /// Adds a pulsing animation to the target. private static func addTargetPulseAnimation(on targetView: TargetView, defaultBeginTime: Double = 0, startTime: Double = 0) { let targetPulse = CABasicAnimation(keyPath: "transform.scale") targetPulse.fromValue = 1 // Regular size targetPulse.toValue = 1.1 // Slightly larger size targetPulse.duration = 0.4 targetPulse.beginTime = defaultBeginTime + startTime targetPulse.autoreverses = true targetPulse.repeatCount = .greatestFiniteMagnitude targetView.targetImageView.layer.add(targetPulse, forKey: "pulse_animation") } }
1
0
587
Oct ’23
UIAlertController no longer appears as a popover in macOS Sonoma
Prior to macOS 14, a Catalyst app could present a UIAlertController as a popover, just as you can on the iPad. While this still works on the iPad, the presentation on macOS now uses the same style as the iPhone. The UIAlertController's popoverPresentationController property is always nil, no matter how it is configured. Doe anyone know of a way to restore the prior behavior under Sonoma?
2
2
605
Oct ’23
WKWebView on Mac Catalyst elementFullscreenEnabled set to YES on WKPreferences but it does not work
Setting elementFullscreenEnabled property to YES on WKPreferences is not honored on Mac Catalyst.  WKWebViewConfiguration *webViewConfig = [[WKWebViewConfiguration alloc]init];  WKPreferences *prefs = [[WKPreferences alloc]init]; prefs.elementFullscreenEnabled = YES;   webViewConfig.preferences = prefs; //then create the WKWebView.. I load a Youtube url in the WKWebView. Youtube complains that the browser doesn't support full screen. Is there a workaround? Full screen does work in an AppKit app though using the exact same API...though it causes an Autolayout crash (I will be making another thread about that separate issue shortly).
4
0
866
Oct ’23
[WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. What does this mean?
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
3
2
989
Oct ’23
Xcode console output is full of CoreUI warnings about image subtype mismatches when running on Mac Catalyst
CoreUI is sending warning messages to the Xcode console when creating a UIImage from an image file with Mac idiom from the asset catalog, while running on Catalyst. My target is set to support running on Mac Catalyst with Optimize for Mac enabled (the latter seems to be the most important part). Loading the image into a UIImage with the designated initializer and presenting it in a UIImageView produces the following console messages: 2023-02-15 10:53:18.014394+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. 2023-02-15 10:53:18.014446+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. 2023-02-15 10:53:18.014503+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. 2023-02-15 10:53:18.014533+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. Working with more than a handful of images from the catalog makes the Xcode console output borderline unreadable because of these messages. The console doesn't have an option to filter out messages (and in general we consider it bad practice to ignore messages on the console). Tested on Xcode 14.2 with macOS 13.2. You can find a sample project at https://github.com/tamasjager/CatalystImageConsoleMessage.
4
5
2k
Oct ’23
Navigation bar not shown in Supplementary view of a UISplitView in macOS Sonoma
I've run into a problem that has been giving me fits for a while and have yet to be able to find a solution. We have a Catalyst app that uses a three-pane UISplitView. The middle and third panes show the navigation bar of the UINavigationController hosted in each pane. However, when building under Xcode 15, the navigation bar is not shown in the middle pane when running under macOS 14. It is shown, as expected, when the app is run under prior versions of macOS. It also appears as it should under macOS 14 if the app is built with Xcode 14. If you push another view controller onto the navigation controller's stack with the animate flag set to true, the navigation bar will appear. When you go back to the root controller, the navigation bar is present as it should be. However, if you push the controller with the animate flag set to false, the navigation bar does not appear. I've been able to reproduce this in an isolated test app with just the relevant components. The first screenshot at the end is from a test app that illustrates the problem. The second screenshot shows what it should look like (and does look like under macOS 13). It should be noted that UINavigationBar.appearance().preferredBehavioralStyle = .pad is set. If any Apple folk would kindly like to look into this, I created a feedback for it: FB13260893. The feedback entry has a sample app, screenshots, and even a screen recording demonstrating the problem. Has anyone else run into this or does anyone have any suggestions for a fix/workaround? Thanks, Kevin
1
1
414
Oct ’23
Enable WKWebView Web Inspector Under Mac Catalyst?
I'm trying to enable the web inspector on WKWebView in a Mac Catalyst app. I'm only doing this for debugging purposes. In the released the web inspector will not be enabled. Doing this under Mac Catalyst does not work:  WKPreferences *prefs = [[WKPreferences alloc]init];   [prefs _setDeveloperExtrasEnabled:YES]; //Assign the WKPreferences to a WKWebViewConfiguration and create the web view.. Is there any way to do this? Thanks in advance.
4
0
1.1k
Oct ’23
Menu works fine in iPad and Mac Catalyst but crashed on Apple Silicon
Hi, I have an iPad app that has menus, like:  CommandGroup(replacing: .help) {                 Button("Help") { showHelp = true }                     .keyboardShortcut("/")  } They works fine in iPad and also if compiled to Mac Catalyst, but will crash on Apple Silicon Mac when selected the menu items with errors like: [General] -[_UIEditMenuInteractionMenuController propertyList]: unrecognized selector sent to instance 0x600000190540 I did not use storyboard and only use SwiftUI. Any suggestions? Note: of course the best solution is to compile to Mac Catalyst, but the app has some other issues when run in Mac Catalyst. So I can only release it as iPad app.
5
0
1.3k
Oct ’23
"Customize Toolbar" on NSToolbar Causes Autolayout Constraints Violation on macOS Sonoma
I have a customizable NSToolbar (using in a Mac Catalyst app "optimized for Mac"). When I right click and choose "Customize toolbar" I get the following error: Conflicting constraints detected: ( "<NSLayoutConstraint:0x6000014a24e0 NSToolbarItemGroupView:0x13de568c0.width <= 88.5 (active)>", "<NSAutoresizingMaskLayoutConstraint:0x6000014f5f90 h=--& v=--& NSToolbarItemGroupView:0x13de568c0.width == 89 (active)>" ). Will attempt to recover by breaking <NSLayoutConstraint:0x6000014a24e0 NSToolbarItemGroupView:0x13de568c0.width <= 88.5 (active)>. Unable to simultaneously satisfy constraints: ( "<NSLayoutConstraint:0x6000014a24e0 NSToolbarItemGroupView:0x13de568c0.width <= 88.5 (active)>", "<NSAutoresizingMaskLayoutConstraint:0x6000014f5f90 h=--& v=--& NSToolbarItemGroupView:0x13de568c0.width == 89 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x6000014a24e0 NSToolbarItemGroupView:0x13de568c0.width <= 88.5 (active)> Set the NSUserDefault >NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have ->[NSWindow visualizeConstraints:] automatically called when this happens. And/or, set a symbolic breakpoint on LAYOUT_CONSTRAINTS_NOT_SATISFIABLE to catch this in the debugger.
1
0
387
Oct ’23
NSOpenPanel returning immediately in MacCatalyst
NSOpenPanel.runModal is returning before the user can select a file. It seemed to get progressively worse as the OS updated. Now with macOS Ventura 13.0 it is completely unusable. Supporting docs https://stackoverflow.com/questions/70050559/nsopenpanel-nssavepanel-runmodal-dismisses-immediately-with-cancel-but-only-on https://stackoverflow.com/questions/28478020/presenting-nsopenpanel-as-sheet-synchronously
7
0
1.3k
Oct ’23
UISplitViewController on Mac Catalyst Collapse the Primary (Sidebar) View Controller by Dragging the Split macOS Style?
So experimenting with UISplitViewController on Mac Catalyst. I have a triple split. The primary view controller is a sidebar. I have the default sidebar button showing in the toolbar and that collapsed/expands the sidebar fine. But when I drag to try to collapse the split (as is typical on macOS) the sidebar doesn't collapse. It clamps to the min. size. Is there anyway to enable this? I tried passing 0 to -setMinimumPrimaryColumnWidth: but that didn't work.
3
0
615
Oct ’23
Exception: NSView this class is not key value coding-compliant for the key cell shortly after presenting UIDocumentPickerViewController on Mac Catalyst
Shortly after presenting a UIDocumentPickerViewController on Mac Catalyst the system throws this exception and I keep hitting my exception breakpoint: NSView: valueForUndefinedKey this class is not key value coding-compliant for the key cell. Appears to be related to the system using Touch Bar APIs (my app isn't currently using Touch Bar APIs directly but the NSOpenPanel created by UIDocumentPickerViewController is). #2 0x0000000198de2828 in -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] () #3 0x000000019884ef3c in -[NSObject(NSKeyValueCoding) valueForKey:] () #4 0x0000000200b75a68 in -[NSObject(UIAccessibilitySafeCategory) __axValueForKey:] () #5 0x0000000200b75960 in __57-[NSObject(UIAccessibilitySafeCategory) safeValueForKey:]_block_invoke () #6 0x0000000200b75f9c in -[NSObject(UIAccessibilitySafeCategory) _accessibilityPerformSafeValueKeyBlock:withKey:onClass:] () #7 0x0000000200b754d0 in -[NSObject(UIAccessibilitySafeCategory) safeValueForKey:] () #8 0x0000000222206b60 in -[NSTouchBarItemAccessibility__UIKit__AppKit _accessibilityPopulateAccessibiltiyInfoFromUIKit] () #9 0x0000000222206b1c in -[NSTouchBarItemAccessibility__UIKit__AppKit _itemViewMinSize:maxSize:preferredSize:stretchesContent:] () #10 0x000000019b3f70bc in -[NSCompressionGroupLayout item:minSize:maxSize:preferredSize:] () #11 0x000000019aff24f4 in -[NSTouchBarItemContainerView _updateMeasuredSizes] () #12 0x000000019aff2358 in -[NSTouchBarItemContainerView minSize] () #13 0x000000019accae98 in -[NSTouchBarLayout _aggregateWidthOfItems:sharesLeftEdge:sharesRightEdge:widthMeasurement:] () #14 0x000000019accb22c in -[NSTouchBarLayout _attributesOfItems:centerItems:givenSize:sharesLeftEdge:sharesRightEdge:xOrigin:] () #15 0x000000019acca930 in -[NSTouchBarLayout attributesOfItems:centerItems:givenSize:] () #16 0x000000019b52bbb0 in -[NSTouchBarView _positionSubviews] () #17 0x000000019b52ba6c in -[NSTouchBarView layout] () -- The exception does get caught (my app doesn't crash) but I hit the exception breakpoint over and over again while the NSOpenPanel is on screen which is annoying.
3
0
891
Oct ’23
NSToolbar Draws On Top of "Full Screen" Video Played in WKWebView in Mac Catalyst app
I have a Mac Catalyst app configured like so: The root view controller on the window is a tripe split UISplitViewController. The secondary view controller in the Split View controller is a view controller that uses WKWebView. Load a website in the WKWebview that has a video. Expand the video to “Full screen” (on Mac Catalyst this is only “Full window” because the window does not enter full screen like AppKit apps do). The NSToolbar overlaps the “Full screen video.” On a triple Split View controller only the portions of the toolbar in the secondary and supplementary columns show through (the video actually covers the toolbar area in the “primary” column). The expected results: -For the video to cover the entire window including the NSToolbar. Actual results: The NSToolbar draw on top of the video. -- Anyone know of a workaround? I filed FB13229032
0
0
386
Oct ’23
WKWebView Unrecognized Selector Sent to Instance: WebAVPlayerLayer - startRedirectingVideoToLayer:forMode:
I'm using WKWebView in a Mac Catalyst app (not sure if using Catalyst makes a difference but it seems WKWebView doesn't get the "full" Mac version AppKit apps do so maybe it does). When a website has a video playing and if I click the button that I guess is a Picture in Picture button next to the "close" button the web kit process gets an unrecognized selector sent to instance exception. -[WebAVPlayerLayer startRedirectingVideoToLayer:forMode: <-- Unrecognized selector. In debugging mode at least my app doesn't crash the video continues to play and the WKWebview is unresponsive to user interaction. I have to force quit my app. -- I'm on Sonoma 14.0
1
1
411
Oct ’23
Mac Catalyst Modally Presented View Controllers Not Working in Xcode Live Previews
I have a UIViewController subclass I'm using in Mac Catalyst. This view controller is only ever presented as a sheet. When I try to make a live preview for it the preview is displayed a gigantic size (not the sheet's actual size at runtime). I made a separate thread about this: https://developer.apple.com/forums/thread/738641 In order to be able to preview the view controller for Mac Catalyst at the desired size I figured I'd present it on another view controller. #Preview { let wrapperVC = WrapperViewController() return wrapperVC } //In WrapperViewController override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if (firstViewDidAppear) { firstViewDidAppear = false view.backgroundColor = UIColor.yellow let realVC = ActualVCIWantToPreview() realVC.modalPresentationStyle = .formSheet present(realVC, animated: false); } } But that's not working. However if I change the device from Mac to iPad it does work so it appears modal presentations aren't working for Live Previews on Mac Catalyst (unless I'm doing something wrong but Xcode is reporting no errors it just isn't showing my presented view controller).
1
0
413
Sep ’23
Mac Catalyst with Live Previews: Any Way to Change the Size the View Controller Preview is Rendered at?
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.
0
0
296
Sep ’23