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
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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?
So with SKStoreReviewController now deprecated... I'm wondering what API is recommended for UIKit apps?
I tried redeeming a promo code for a subscription on iOS 18.
It's a yearly subscription (the promo code is for myself in this case). This always worked before. Now on iOS 18 when I redeem the code in the App Store it just spins an activity indicator in the navigation bar for a few seconds and stops. Promo code doesn't redeem. No error message either.
Now when I try to redeem the promo code on the Mac App Store I get the following error: "You must redeem this code on a device that supports App name". This error makes sense because the app is iOS/iPadOS only. But the fact that the Mac App Store displays the App name in the error message indicates that the code is valid and should work on iOS, but it does not.
I just boxed up AppTransaction API. In the debug environment it appears to always return a VerificationResult that is .verified
Unlike Storekit1 calling AppTransaction.shared does not seem to cause a sandbox receipt to actually get written on the app bundle in Derived data.
I was trying to purposefully mess with the receipt in order to get AppTransaction to fail so I can test how my app behaves when errors occur but there is no receipt to mess with. I tried using the old exit(173) API and it does cause a receipt to be fetched but that seems to be completely ignored by AppTransaction, it validates even if you trash or tamper with the receipt given by exit(173).
Is there a good way to test receipt validation failure using the high level Storekit2 API?
Previously I was able to "snapshot" view that were not part of any window hierarchy using the following:
NSImage *buttonImage = [NSImage imageWithSystemSymbolName:@"49.circle.fill" accessibilityDescription:nil];
NSButton *aButton = [NSButton buttonWithImage:buttonImage target:nil action:nil];
[aButton sizeToFit];
NSBitmapImageRep *rep = [aButton bitmapImageRepForCachingDisplayInRect:aButton.bounds];
if (rep == nil) {
NSLog(@"Failed to get bitmap image rep.");
return;
}
[aButton cacheDisplayInRect:aButton.bounds toBitmapImageRep:rep];
NSData *tiffData = rep.TIFFRepresentation;
NSImage *snapShotOfImage = [[NSImage alloc]initWithData:tiffData];
Now on macOS Tahoe I get a non nil image, but the image is blank.
However if I add aButton NSWindow's view hiearchy just before the call to -cacheDisplayInRect:toBitmapImageRep: I do get a proper image.
Is this behavior intended or is this considered a bug? Is it documented anywhere that a view must be in a NSWindow for -cacheDisplayInRect:toBitmapImageRep: to work? Thanks
I have Mac apps that embed “Helper Apps” inside their main bundle. The helper apps do work on behalf of the main application.
The helper app doesn’t show a dock icon, it does show minimal UI like an open panel in certain situations (part of NSService implementation). And it does make use of the NSApplication lifecycle and auto quits after it completes all work.
Currently the helper app is inside the main app bundle at: /Contents/Applications/HelperApp.app
Prior to Tahoe these were never displayed to user in LaunchPad but now the Spotlight based AppLauncher displays them.
What’s the recommended way to get these out of the Spotlight App list on macOS Tahoe?
Thanks in advance.
I'm trying to create a dynamic menu on Mac Catalyst. Using a UIBarButtonitem like so to make a "pull down" button:
UIDeferredMenuElement *deferredmenuElement;
deferredmenuElement = [UIDeferredMenuElement elementWithUncachedProvider:^(void (^ _Nonnull completion)(NSArray<UIMenuElement *> * _Nonnull))
{
UIAction *actionOne = [UIAction actionWithTitle:@"Action One" image:nil identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
NSLog(@"action one fired.");
}];
UIAction *actionTwo = [UIAction actionWithTitle:@"Action Two" image:nil identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
NSLog(@"action two fired.");
}];
UIAction *actionThree = [UIAction actionWithTitle:@"Action Three" image:nil identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
NSLog(@"action three fired.");
}];
completion(@[actionOne,actionTwo,actionThree]);
}];
UIMenu *wrappedMenu = [UIMenu menuWithChildren:@[deferredmenuElement]];
UIBarButtonItem *uiBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:nil
menu:wrappedMenu];
uiBarButtonItem.image = [UIImage systemImageNamed:@"rectangle.and.pencil.and.ellipsis"];
self.navigationItem.rightBarButtonItems = @[uiBarButtonItem];
The button appears in the toolbar but when I click it to expose the menu I get a menu with on element in it that says "Loading...". The the uncached provider block is never called.
Running Ventura 13.2.1 and Xcode 14.2.
In a SwiftUI source file Xcode displays a window with a Split View. The first split is the source code and the second split is the preview.
My question is, is there a way for me to have the preview take over the entire window width (I want to collapse the source code pane and just look at the preview)?
I can easily collapse the Preview pane by dragging the split to the right to collapse (but it doesn't work in reverse). I also can toggle the preview pane by going to Editor -> Canvas in the Menu bar.
Currently I'm using SwiftUI just to get a live preview of UIKit view controllers so I'm not interested in looking at the SwiftUI source code, though I imagine displaying a full window preview in a separate window would be useful for SwiftUI developers too. You could edit the source code on one monitor and have the preview window on an external display. Is this not possible?
I'm using compositional layout with UICollectionView. In a particular section I configure the compositional layout to use an estimated height because I want self sizing items determined by Autolayout Constraints.
Now I have a custom content configuration with autolayout constraints. At runtime I hit this log about conflicting constraints:
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
[...]
<NSLayoutConstraint:0x6000024af160 UIImageView:0x120745520.height == 130 (active)>
<NSLayoutConstraint:0x6000024af2a0 MyCustomContentView :0x120748d60.height >= 1.04839*UIImageView:0x120745520.height (active)>
<NSLayoutConstraint:0x6000024b08c0 'UIView-Encapsulated-Layout-Height' UICollectionViewListCell:0x1214392f0.height == 44 (active)>
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000024af160 UIImageView:0x120745520.height == 130 (active)>
The "UIView-Encapsulated-Layout-Height" on UICollectionViewListCell with a value of 44.0 appears to be a constraint created by the system. I'm not sure why a hard coded height of 44.0 is being used when the compositional layout is returning a section that only uses estimated heights (created via NSCollectionLayoutDimension estimatedDimension).
Any ideas how I can avoid this? I'm not using custom UICollectionView cells but I am using a custom content configuration and a custom content view and setting my content configuration on a UICollectionViewListCell.
In Xcode 15 Live Previews are available for UIKit view controllers and views. However I noticed they do not work if the deployment target is < 17.0.
If I try to make a live preview for a view controller like so:
#Preview {
let someVC = ViewController()
return someVC
}
It doesn't load.
The error is described below:
== PREVIEW UPDATE ERROR:
CompileDylibError: Failed to build ASwiftViewController.swift
Compiling failed: module 'SwiftUI' has no member named 'VStack'
If I raise the deployment target to iOS 17 it starts working.
I'm looking for the AVAudioEngine in Practice video from WWDC 2014 (session 502) but can't seem to find it anywhere.
Does anyone have a link to this session video? I can only find the slides. Thanks.
I wrote a little something that uses WKWebView. It seems that print: does not work though (macOS app).I'm kind of regretting using WKWebView over the old school WebView...anyone have a workaround?
Uploading an App Preview Video for a Mac App Fails with Error "Your app preview contains unsupported or corrupted audio" even though the video contains no audio.
Anyone run into this and know of a workaround?
I filed FB12151982
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
App Submission
In NSFileManager there is this method to move files to and from iCloud:- (BOOL)setUbiquitous:(BOOL)flag itemAtURL:(NSURL *)url destinationURL:(NSURL *)destinationURL error:(NSError **)errorOutAll the samples and information I'm able to find seem to be related to using NSDocument, which my app isn't using. I have a little view in my app that allows users to move an image out from the iCloud container and into a local directory. It seems that simply using NSFileManager moveItemAtURL:toURL:error: works fine both to move a file in and out of the iCloud container on OS X without wrapping everything in a file coordinator block. Is it still necessary to use a file coordinator to move files out of iCloud on the Mac. When I put a file in the iCloud container, the system automatically starts uploading it..even though I'm not using a file coordinator...and my related file presenter still is detecting a change.Both methods seem to be working the same, I'm just wondering if I should be using a coordinator because it's a good amount of code I can get rid of if it's not necessary.Thanks.