Airplaying video doesn't seem to be working on Mac Catalyst (works on iOS). I'm on the same network.
Testing on Youtube. The "Airplay" button appears but clicking it does nothing. Anyone else experiencing this?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I set the elementFullscreenEnabled property on WKPreferences to YES. On iPad this enables web videos to be played in full screen.
However when I play the video and rotate the device, the layout becomes completely broken on orientation change. Anyone know of a workaround?
I can key value observe the web view's full screen state property but there is no obvious way to get ahold of the UI being used to play the video?
When playing a video in WKWebView I get this exception thrown after playing a video in "Full window mode" (that is when video takes over the size of the window, not to be confused with "full screen mode").
I'm running on Mac Catalyst.
#1 0x0000000188855800 in -[NSException raise] ()
#2 0x0000000189c2170c in -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] ()
#3 0x000000018968db9c in -[NSObject(NSKeyValueCoding) valueForKey:] ()
#4 0x000000018968da04 in -[NSObject(NSKeyValueCoding) valueForKeyPath:] ()
#5 0x00000001b9709a10 in -[AVPlaybackControlsController _observeBoolForKeyPath:usingKeyValueObservationController:observationHandler:] ()
#6 0x00000001b97066a8 in -[AVPlaybackControlsController _startObservingForPlaybackViewUpdates] ()
#7 0x00000001b9708ad4 in -[AVPlaybackControlsController _updatePlaybackControlsVisibleAndObservingUpdates] ()
#8 0x00000001b96db568 in __81-[AVPlayerViewController transitionController:willBeginPresentingViewController:]_block_invoke ()
#9 0x00000001b290f3ec in -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] ()
#10 0x00000001b28e01cc in -[_UIViewControllerTransitionContext _runAlongsideCompletions] ()
#11 0x00000001b28df984 in -[_UIViewControllerTransitionContext completeTransition:] ()
#12 0x00000001b972300c in __35-[AVTransition completeTransition:]_block_invoke ()
#13 0x00000001b96da368 in -[AVPlayerViewController transitionController:transitionWillComplete:continueBlock:] ()
#14 0x00000001b9736448 in -[AVTransitionController transitionWillComplete:success:continueBlock:] ()
#15 0x00000001b9722e44 in -[AVTransition completeTransition:] ()
#16 0x00000001b2b08a04 in -[UIViewPropertyAnimator _executeCompletionHandlerWithFinalPosition:] ()
#17 0x00000001b2b08ac4 in -[UIViewPropertyAnimator _runCompletions:finished:] ()
#18 0x00000001b2b07b10 in __61-[UIViewPropertyAnimator _setupAssociatedViewAnimationState:]_block_invoke ()
#19 0x00000001b375214c in UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK ()
#20 0x00000001b28e2258 in -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] ()
#21 0x00000001b28e1d8c in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
#22 0x00000001b297c330 in -[UIViewAnimationState animationDidStop:finished:] ()
#23 0x0000000213b66110 in -[UIViewAnimationStateAccessibility animationDidStop:finished:] ()
#24 0x000000018fe7e288 in CA::Layer::run_animation_callbacks(void*) ()
And the exception is: "[<WebAVPlayerController valueForUndefinedKey:]: this class is not key value coding-compliant for the key coordinatedPlaybackActive."**
I notice on some pages to be having text selection issues on Mac Catalyst. AppKit WKWebview appears to work better. Is there a workaround?
Related:
https://stackoverflow.com/questions/74959180/how-to-use-appkit-wkwebview-in-a-mac-catalyst-app
https://stackoverflow.com/questions/61215569/macos-maccatalyst-wkwebview-text-selection-behavior
Would be great if Mac Catalyst just got the normal Mac WKWebView but there appears to be differences.
I'm getting some new behavior I haven't seen before (on Venture 13.2.1) on UITableView.
Steps to reproduce:
A table view row is selected and I swipe to delete the selected row.
After about a half of a second the table view selects another row.
I'm not programmatically making a selection here after the swipe to delete. UIKit is doing it.
I set a breakpoint in -tableView:didSelectRowAtIndexPath: and it is related to the focus system:
#1 0x00000001b350b140 in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:] ()
#2 0x00000001b3512df8 in -[UITableView _didUpdateFocusInContext:withAnimationCoordinator:] ()
#3 0x0000000213b38988 in -[UITableViewAccessibility _didUpdateFocusInContext:withAnimationCoordinator:] ()
#4 0x00000001b2f54260 in __84-[UIFocusSystem _sendDidUpdateFocusNotificationsInContext:withAnimationCoordinator:]_block_invoke ()
#5 0x00000001b2f08944 in _UIFocusEnvironmentEnumerateAncestorEnvironments ()
#6 0x00000001b2f54480 in -[UIFocusSystem _sendNotificationsForFocusUpdateInContext:withAnimationCoordinator:usingBlock:] ()
#7 0x00000001b2f53ff0 in -[UIFocusSystem _sendDidUpdateFocusNotificationsInContext:withAnimationCoordinator:] ()
#8 0x00000001b2f53630 in -[UIFocusSystem _updateFocusWithContext:report:] ()
#9 0x00000001b2f5319c in -[UIFocusSystem updateFocusIfNeeded] ()
#10 0x00000001b2f561dc in __43-[UIFocusSystem _updateFocusUpdateThrottle]_block_invoke ()
#11 0x00000001b3725e70 in -[_UIAfterCACommitBlock run] ()
#12 0x00000001b37262cc in -[_UIAfterCACommitQueue flush] ()
#13 0x00000001b2851630 in _runAfterCACommitDeferredBlocks ()
#14 0x00000001b28513ac in _cleanUpAfterCAFlushAndRunDeferredBlocks ()
#15 0x00000001b28512c8 in _afterCACommitHandler ()
#16 0x00000001887b0db8 in CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION ()
#17 0x00000001887b0ca4 in __CFRunLoopDoObservers ()
This wasn't happening before. I'm not sure if it is related to the Ventura 13.2.1 update or if there is some minor tweak on my end that is causing this change in behavior though I'm not thrilling with UIKit making a selection without asking me about it.
I could live with the automatic row selection if the next row below the deleted row was automatically selected but sometimes it is not. Sometimes UITableView is auto selecting a row two cells back which doesn't make any sense to me.
My configuration:
A iOS app that supports Mac Catalyst. This Mac Catalyst app is “optimized for Mac” it is not scaled to match iPad.
I open the asset catalog and add a “Data Asset” which is a .txt file. This is set to “Universal.”
I add “Mac” variant for this data asset and I add a .txt with different text.
I load the string at runtime like this:
NSDataAsset *scriptData = [[NSDataAsset alloc]initWithName:@"TextDataAsset"];
NSString *loadedText = [[NSString alloc]initWithData:scriptData.data encoding:NSUTF8StringEncoding];
When I run that on Mac Catalyst the text loadedText is an empty string, which is wrong. Running on iOS I get the expected string.
Is this the intended behavior? Am I supposed to use the "iPad" device for Mac assets (because I don't believe that is the case with images, etc.)
In any case I filed FB12005255
I have an area in my app where I load local HTML strings in WKWebView. Loading is fast on iOS. These local HTML strings are small.
On Mac Catalyst I added the ability to open this area of the UI in a new window scene (new window). And for some reason sometimes when I do this these simple HTML strings can take 10-15 seconds to load in the WKWebview in the new window.
These HTML strings are super small. I key value observed the loading property of the WKWebview and I hold the current date just before calling -loadHTMLString:baseURL:
Then when the web view completes loading I see how much time passed:
-(void)observeValueForKeyPath:(NSString*)keyPath
ofObject:(id)object
change:(NSDictionary<NSKeyValueChangeKey,id>*)change
context:(void*)context
{
if (object == self.webview
&& [keyPath isEqualToString:@"loading"])
{
if (!self.webview.isLoading)
{
NSTimeInterval timeInterval = [NSDate.date timeIntervalSinceDate:self.loadStartDate];
NSLog(@"Web view took %f seconds to load",timeInterval);
}
}
else
{
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}
Sometimes it is taking as long as 5 seconds to load a tiny HTML string. When opening these WKWebviews in the same window I don't get these long load times. But when I kick of WKWebView inside a new window scene I often do.
I'm trying to share a directory on my Mac with a virtual machine I created using the Virtualization framework. The virtual machine is running Fedora. I configure the share like this:
NSError *error = nil;
if ([VZVirtioFileSystemDeviceConfiguration validateTag:tag error:&error])
{
//Tag validates...
VZSharedDirectory *sharedDirectiory = [[VZSharedDirectory alloc]initWithURL:theURL readOnly:NO];
VZSingleDirectoryShare *singleDirectoryShare = [[VZSingleDirectoryShare alloc]initWithDirectory:sharedDirectiory];
VZVirtioFileSystemDeviceConfiguration *shareConfig = [[VZVirtioFileSystemDeviceConfiguration alloc]initWithTag:tag];
shareConfig.share = singleDirectoryShare;
virtualMachineConfiguration.directorySharingDevices = @[shareConfig];
}
The virtual machine starts up without any errors but the shared directory is nowhere to be found. Anyone know where am I'm going wrong?
Thanks in advance.
I use UNUserNotificationCenterDelegate. I'm in the process of adding new scene configurations for windows for the Mac environment. Some of these windows are auxiliary windows.
So I was just wondering what happens with UNNotificationResponse targetScene property.
In -userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: is it possible for one of the auxiliary window scenes to be the targetScene or does UNNotificationResponse always choose the configuration at index 0 in the info.plist?
Looking to get column resizing events for UISplitViewController. I have a UITableView inside on of the columns and when the column is resized I need to invalidate the intrinsic content size of the table view cells to recompute row height.
Best place to handle this?
I have a UITabBarController on Mac Catalyst. Since the UITabBar isn't really nice on Mac, I set the UITabBar to hidden.
Then I create a Mac styled NSToolbar with selectable items and manually change the UITabBarController selection with the NSToolbar selection (like the UITabBar would do normally on iOS).
This works fine until I select view controller at index 7 or greater. Then all of a sudden an iOS styled UINavigationBar appears. UITabBarController is wrapping view controllers at index 7 or greater in the "More Navigation Controller" which is not desired or needed (the window width is wide enough to avoid clipping, and the UITabBar is not even visible).
It is normal to have a preference like: “Always use Dark Mode” in an app to allow the user to opt in to Dark mode in the current app without turning it on System wide.
On iOS you can manage this by detecting the change in the app preference and when it is turned on you set the overrideUserInterfaceStyle property on the UIWindow to UIUserInterfaceStyleDark. On Mac Catalyst however this does not work. If you set the overrideUserInterfaceStyle property to UIUserInterfaceStyleDark the NSWindow underneath doesn’t update to reflect dark mode. The titlebar doesn’t update for dark mode either. And neither does the NSToolbar. Only UIViewControllers inside the UIWindow reflect the overrideUserInterfaceStyle
Ideally it would be great if there was a overrideUserInterfaceStyle property on UIApplication but there is not. Is there a way to force the NSWindow/NSToolbar created by Mac Catalyst to use a particular appearance (without an Appkit bundle)?
The newer documentation about creating a Settings.bundle on Mac Catalyst simply links out to the Documentation Archive:
https://developer.apple.com/library/archive/documentation/PreferenceSettings/Conceptual/SettingsApplicationSchemaReference/Articles/PSGroupSpecifier.html#//apple_ref/doc/uid/TP40007009-SW1
The SupportedUserInterfaceIdioms key is documented:
Indicates that the element is displayed only on specific types of devices. The value of this key is an array of strings with the supported idioms. Include the string “Phone” to display the element on iPhone and iPod touch. Include the string to “Pad” to display it on iPad.
This key is available in iOS 4.2 and later.
Is "Mac" a supported entry to specify a preference for the Mac idiom? It seems to work but I don't see any documentation for this.
Is there any way to create radio buttons on Mac Catalyst in the Mac idiom (without writing my own from scratch obviously)?
Creating a Settings bundle with PSRadioGroupSpecifier creates a radio button group in the Preference pane but I don't see a way to do this in my own UI?
Is there a way to get native AppKit radio buttons on Mac Catalyst?
Is there any UIKit API that bridges to NSBox in the Mac idiom?