Posts

Post not yet marked as solved
3 Replies
1.2k Views
Hi,I'm trying to figure out how an NSViewController can check if it was presented as a popvoer, so it might by notification and delegate pattern inform observers and let delegate act upon disappearing of the popover by overriding viewWillDisappear method.So far I've with this solution:- (BOOL)isPresentedAsPopover { id popoverFrameClass = NSClassFromString(@"NSPopoverFrame"); id ourSuperViewClass = [[[self view] superview] class]; return [ourSuperViewClass isEqualTo:popoverFrameClass]; }I've found that when a NSViewController is presented as popover programmatically via presentViewController:asPopoverRelativeToRect:ofView:preferredEdge:behavior: method its view gets embedded in a NSPopoverFrame class view.Which seems to be part of a class cluster pattern, hence it's a private class. I don't like this kind of solution, knowing that in future this could change etc.Is there a better way to do that, rather than setting boolean property value in the View Controller when presenting it programmatically as a popover?
Posted
by vale_mac.
Last updated
.
Post not yet marked as solved
0 Replies
495 Views
Hi, I'd like to start playing around with the new Swift Concurrency framework in a Swift Package, but I cannot use AsyncSequence. AsyncSequence is not available despite I'm using swift-tools-version:5.5 in my package manifest.
Posted
by vale_mac.
Last updated
.