Post

Replies

Boosts

Views

Activity

Reply to Collapse button NavigationView SideBar SwiftUI
func setDisplayModeButtonVisibilityHidden() {     typealias BlockType = @convention(c) (Any, Selector, UISplitViewController.Style) -> Any     let selector: Selector = #selector(UISplitViewController.init(style:))     let method: Method = class_getInstanceMethod(NSClassFromString("SwiftUI.NotifyingMulticolumnSplitViewController"), selector)!     let originalImp: IMP = method_getImplementation(method)     let original: BlockType = unsafeBitCast(originalImp, to: BlockType.self)     let new: @convention(block) (Any, UISplitViewController.Style) -> Any = { (me, arg0) -> Any in         let object: UISplitViewController = original(me, selector, arg0) as! UISplitViewController         object.displayModeButtonVisibility = .never         return object     }     let newImp: IMP = imp_implementationWithBlock(new)     method_setImplementation(method, newImp) } ... on your @main App, @main struct YourApp: App {     init() {         setDisplayModeButtonVisibilityHidden()     } / ** / }
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’22
Reply to Image Playground API
You can use it right now. See the /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImagePlayground.framework/Versions/A/Modules/ImagePlayground.swiftmodule/arm64e-apple-macos.swiftinterface file. Here's my sample project for iOS. https://github.com/pookjw/ImagePlaygroundExample
Topic: UI Frameworks SubTopic: General Tags:
Nov ’24
Reply to Access persona on VisionOS
If you want to access Persona without using SharePlay or Group Activity, use AVFoundation. Get Front Camera Capture Device using AVCaptureDeviceDiscoverySession. Front Camera Capture Device will present Persona. Enterprise API is not required. Configure AVCaptureSession with Front Camera Capture Device and AVCaptureVideoDataOutput. Get Sample Buffers from AVCaptureVideoDataOutput. Render it using Metal (CAMetalLayer or Compositor Services), or UIImageView (easy, but not recommended).
Topic: Spatial Computing SubTopic: ARKit Tags:
Nov ’24
Reply to "Field 'recordName' is not marked queryable" error when accessing cloud kit data
If you want to fetch all records, you don't need to query with true predicate. Also you don't need to mark recordName as queryable. You can fetch all records using CKFetchRecordZoneChangesOperation with empty. container.privateCloudDatabase.fetchAllRecordZones { zones, _ in let zoneIDs = zones!.map { $0.zoneID } let zoneOperation = CKFetchRecordZoneChangesOperation(recordZoneIDs: zoneIDs, configurationsByRecordZoneID: nil) zoneOperation.recordWasChangedBlock = { recordID, result in print(result) } self.container.privateCloudDatabase.add(zoneOperation) }
Mar ’25
Reply to Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
My complete script xcodebuild -deleteComponent metalToolchain sudo rm -rf ~/Library/Developer/DVTDownloads/MetalToolchain/ sudo rm -rf ~/Library/Developer/DVTDownloads/Assets/MetalToolchain/ sudo rm -rf /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/ rm -rf /tmp/MyMetalExport/ xcodebuild -downloadComponent metalToolchain -exportPath /tmp/MyMetalExport/ sed -i '' -e 's/17A5241l/17A5241n/g' /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle/ExportMetadata.plist xcodebuild -importComponent metalToolchain -importPath /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle
Topic: Graphics & Games SubTopic: Metal Tags:
Jul ’25
Reply to Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
Updated (Only for Xcode 26.0 beta 2) Delete all Metal toolchains at Xcode Settings - Components. (If you scroll down at Components view, you can see additional Metal toolchains. Delete them if exists.) Quit Xcode. Run these commands xcodebuild -deleteComponent metalToolchain sudo rm -rf ~/Library/Developer/DVTDownloads/MetalToolchain/ sudo rm -rf ~/Library/Developer/DVTDownloads/Assets/MetalToolchain/ sudo rm -rf /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/ rm -rf /tmp/MyMetalExport/ xcodebuild -downloadComponent metalToolchain -exportPath /tmp/MyMetalExport/ sed -i '' -e 's/17A5241l/17A5241o/g' /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle/ExportMetadata.plist xcodebuild -importComponent metalToolchain -importPath /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle Reboot your Mac immediately. Open Xcode and do not open Xcode Settings. Build your project immediately.
Topic: Graphics & Games SubTopic: Metal Tags:
Jul ’25
Reply to I cannot acquire entitlement named com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning.
I still cannot acquire com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning entitlement. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning</key> <true/> <key>com.apple.developer.spatial-audio.profile-access</key> <true/> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.device.audio-input</key> <true/> <key>com.apple.security.device.camera</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.personal-information.location</key> <true/> <key>com.apple.security.personal-information.photos-library</key> <true/> </dict> </plist> Showing All Messages .xcodeproj: Provisioning profile "iOS Team Provisioning Profile: " doesn't include the com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning entitlement.
Jul ’25
Reply to UIDragItem causes memory leak when Context Menu has been initialised
Did you solve this problem?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to Collapse button NavigationView SideBar SwiftUI
func setDisplayModeButtonVisibilityHidden() {     typealias BlockType = @convention(c) (Any, Selector, UISplitViewController.Style) -> Any     let selector: Selector = #selector(UISplitViewController.init(style:))     let method: Method = class_getInstanceMethod(NSClassFromString("SwiftUI.NotifyingMulticolumnSplitViewController"), selector)!     let originalImp: IMP = method_getImplementation(method)     let original: BlockType = unsafeBitCast(originalImp, to: BlockType.self)     let new: @convention(block) (Any, UISplitViewController.Style) -> Any = { (me, arg0) -> Any in         let object: UISplitViewController = original(me, selector, arg0) as! UISplitViewController         object.displayModeButtonVisibility = .never         return object     }     let newImp: IMP = imp_implementationWithBlock(new)     method_setImplementation(method, newImp) } ... on your @main App, @main struct YourApp: App {     init() {         setDisplayModeButtonVisibilityHidden()     } / ** / }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to @Environment(\.dismiss) var dismiss - Infinite loop bug.
same
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to SwiftUI View leaks in iOS 17
My solution without using UIKit Presentation style: https://gist.github.com/pookjw/093dfbe43714bb0ceec2e4df1d5a9499 Caution: It's super unsafe.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to Image Playground API
You can use it right now. See the /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImagePlayground.framework/Versions/A/Modules/ImagePlayground.swiftmodule/arm64e-apple-macos.swiftinterface file. Here's my sample project for iOS. https://github.com/pookjw/ImagePlaygroundExample
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Access persona on VisionOS
If you want to access Persona without using SharePlay or Group Activity, use AVFoundation. Get Front Camera Capture Device using AVCaptureDeviceDiscoverySession. Front Camera Capture Device will present Persona. Enterprise API is not required. Configure AVCaptureSession with Front Camera Capture Device and AVCaptureVideoDataOutput. Get Sample Buffers from AVCaptureVideoDataOutput. Render it using Metal (CAMetalLayer or Compositor Services), or UIImageView (easy, but not recommended).
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to CoreML 6 beta 2 - Failed to create CVPixelBufferPool
The issue is not caused by invalid Image. I debugged the MLRecipeExecutionService, it was found that the problem occurs because it is unable to allocate an IOSurface. This issue only happens when using the V2 Feature Extractor. It is resolved by trying with macOS 14.6.1 and Xcode 15.4.
Replies
Boosts
Views
Activity
Dec ’24
Reply to "Field 'recordName' is not marked queryable" error when accessing cloud kit data
If you want to fetch all records, you don't need to query with true predicate. Also you don't need to mark recordName as queryable. You can fetch all records using CKFetchRecordZoneChangesOperation with empty. container.privateCloudDatabase.fetchAllRecordZones { zones, _ in let zoneIDs = zones!.map { $0.zoneID } let zoneOperation = CKFetchRecordZoneChangesOperation(recordZoneIDs: zoneIDs, configurationsByRecordZoneID: nil) zoneOperation.recordWasChangedBlock = { recordID, result in print(result) } self.container.privateCloudDatabase.add(zoneOperation) }
Replies
Boosts
Views
Activity
Mar ’25
Reply to visionOS Window launch size
Only apps with a bundle identifier starting with com.apple. support UILaunchPlacementParameters. (SurfBoardFramework)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
My complete script xcodebuild -deleteComponent metalToolchain sudo rm -rf ~/Library/Developer/DVTDownloads/MetalToolchain/ sudo rm -rf ~/Library/Developer/DVTDownloads/Assets/MetalToolchain/ sudo rm -rf /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/ rm -rf /tmp/MyMetalExport/ xcodebuild -downloadComponent metalToolchain -exportPath /tmp/MyMetalExport/ sed -i '' -e 's/17A5241l/17A5241n/g' /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle/ExportMetadata.plist xcodebuild -importComponent metalToolchain -importPath /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
Updated (Only for Xcode 26.0 beta 2) Delete all Metal toolchains at Xcode Settings - Components. (If you scroll down at Components view, you can see additional Metal toolchains. Delete them if exists.) Quit Xcode. Run these commands xcodebuild -deleteComponent metalToolchain sudo rm -rf ~/Library/Developer/DVTDownloads/MetalToolchain/ sudo rm -rf ~/Library/Developer/DVTDownloads/Assets/MetalToolchain/ sudo rm -rf /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/ rm -rf /tmp/MyMetalExport/ xcodebuild -downloadComponent metalToolchain -exportPath /tmp/MyMetalExport/ sed -i '' -e 's/17A5241l/17A5241o/g' /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle/ExportMetadata.plist xcodebuild -importComponent metalToolchain -importPath /tmp/MyMetalExport/MetalToolchain-17A5241l.exportedBundle Reboot your Mac immediately. Open Xcode and do not open Xcode Settings. Build your project immediately.
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
Updated for Xcode 26.0 beta 3 (17A5276g) Navigate to this file: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/*.asset/AssetData/Restore/*.dmg and mount it.
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to I cannot acquire entitlement named com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning.
I still cannot acquire com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning entitlement. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning</key> <true/> <key>com.apple.developer.spatial-audio.profile-access</key> <true/> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.device.audio-input</key> <true/> <key>com.apple.security.device.camera</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.personal-information.location</key> <true/> <key>com.apple.security.personal-information.photos-library</key> <true/> </dict> </plist> Showing All Messages .xcodeproj: Provisioning profile "iOS Team Provisioning Profile: " doesn't include the com.apple.developer.avfoundation.video-data-output-prepares-cellular-radio-for-machine-readable-code-scanning entitlement.
Replies
Boosts
Views
Activity
Jul ’25