Post

Replies

Boosts

Views

Activity

Reply to ES sample project
Hello @eskimo, When using the amfi_get_out_of_my_way bootarg to enable an Endpoint Security system extension loading, on macOS Sonoma 14.2 (all betas so far), there seems to be a bug introduced where task_set_exception_ports and related APIs fail with GUARD_TYPE_MACH_PORT: Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_GUARD (SIGKILL) Exception Codes: GUARD_TYPE_MACH_PORT Exception Codes: 0x00000000000048e0, 0x0000000000000000 Termination Reason: Namespace GUARD, Code 2305843035510950112 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18c8e0854 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x18c8f2cd0 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x18c90ac78 task_swap_exception_ports + 368 This affects a lot of third-party software, such as 1Password, Firefox, Tower, etc. In the past, another boot arg was needed to prevent crashes: ipc_control_port_options. Is there anything new introduced in Sonoma 14.2 in this regard? Thank you in advance
Nov ’23
Reply to Display HDR images for PhotoKit assets
For images, use the requestImageDataAndOrientation(for:options:resultHandler:) method to obtain a photo’s data, which contains the HDR information. Then you can use CGImageSource, UIImageReader with prefersHighDynamicRange, CIImage, etc. to obtain a UIImage that will correctly display on HDR screens. For live photos, it’s more complicated. The PHLivePhoto object obtained from requestLivePhoto(for:targetSize:contentMode:options:resultHandler:) does not contain an HDR image. You can use requestImageDataAndOrientation(for:options:resultHandler:) to obtain the HDR version of the image, as above, but displaying it in a PHLivePhotoView is not as simple. There is private API you can use, which I’ll post below, but it’s up to you to decide if that’s risky for you. All private API can be hidden, if the only thing you fear is App Store submission. fileprivate static func fudgeLiveView(_ liveView: PHLivePhotoView, with image: UIImage?) { if let image { liveView.setValue(image, forKeyPath: "playerView.overrideImage") } guard let view = liveView.value(forKeyPath: "playerView.subviews.@firstObject") as? UIView else { return } for subview in view.subviews { if let imageView = subview as? UIImageView { imageView.preferredImageDynamicRange = .high } } }
Apr ’24
Reply to Display HDR images for PhotoKit assets
I now see that PHImageRequestOptions has the following private properties, which you can use to obtain and fine-tune HDR images using all image loading APIs: @property (nonatomic) BOOL includeHDRGainMap; @property (nonatomic) BOOL includeHDRGainMapInIntermediateImage; @property (nonatomic) BOOL preferHDR; @property (nonatomic) double targetHDRHeadroom;
Apr ’24
Reply to UISplitViewController and UITabBarController in iOS 15 is always full screen
For posterity, the issue still exists in iOS 17, and it’s by Apple’s assumption that a split view controller is always a window’s root view controller. You can workaround this by overriding the trait collection of the split view controller when the parent tab bar controller’s collection changes: override func willTransition(to newCollection: UITraitCollection, with coordinator: any UIViewControllerTransitionCoordinator) { super.willTransition(to: newCollection, with: coordinator) coordinator.animate { _ in if let split = viewControllers?.first as? SplitViewController { setOverrideTraitCollection(newCollection, forChild: split) } } }
Apr ’24
Reply to Options button in the UIActivityViewController
It’s UIActivityViewController with private API: https://developer.limneos.net/index.php?ios=17.1&framework=SafariServices.framework&header=UIActivityViewControllerObjectManipulationDelegate.h @protocol UIActivityViewControllerObjectManipulationDelegate <NSObject> @optional -(BOOL)_customizationAvailableForActivityViewController:(id)arg1; -(id)customActionViewControllerForActivityViewController:(id)arg1; -(id)customLocalizedActionTitleForActivityViewController:(id)arg1; @required -(id)_customizationGroupsForActivityViewController:(id)arg1; @end
Oct ’24