Post

Replies

Boosts

Views

Activity

iOS 18 beta - Cancelling Interactive UICollectionView Layout Transition causes the collectionView to disappear
On iOS18 beta1 & beta2 builds, calling collectionView.cancelInteractiveTransition() after a call to startInteractiveTransition(to:completion:) seems to remove the intermediate transition layout object from the collection view, but doesn't reinstalls the original layout, which results in the collection view disappearing completely. This was not the case in previous iOS versions, so maybe a beta bug? Possibly related, Xcode logs the following error in the console in the exact moment when the collectionView disappears: “Requesting visual style in an implementation that has disabled it, returning nil. Behavior of caller is undefined.” I filled a bug report, together with sample project, just in case FB14057335 Thanks!
1
0
446
Jun ’24
How to cancel a Drag/Drop item loading in UIKit
After a drag/drop of an item into my app's collectionView, UIKit shows this progress UI while the data loads: How do I cancel the loading of the dropped items when the user cancels? The itemProvider.loadFileRepresentation completion block is always called without error. What am I missing? coordinator.session.progress.cancellationHandler = { Task { @MainActor in // User canceled the dropped items loading } } for item in coordinator.items { item.dragItem.itemProvider.loadFileRepresentation(forTypeIdentifier: AVFileType.mov.rawValue) { [ weak self] (videoURL, error) in // This completion block will get called even after operation was canceled. } }
0
0
405
Feb ’24
PHExternalAssetResource: Unable to issue sandbox extension for file.mov
I'm trying to add a video asset to my app's photo library, via drag/drop from the Photos app. I managed to get the video's URL from the drag, but when I try to create the PHAsset for it I get an error: PHExternalAssetResource: Unable to issue sandbox extension for /private/var/mobile/Containers/Data/Application/28E04EDD-56C1-405E-8EE0-7842F9082875/tmp/.com.apple.Foundation.NSItemProvider.fXiVzf/IMG_6974.mov Here's my code to add the asset: let url = URL(string: videoPath)! PHPhotoLibrary.shared().performChanges({ PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: url) }) { saved, error in // Error !! } Addictionally, this check is true in the debugger: UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(videoPath) == true Note that adding still images, much in the same way, works fine. And I naturally have photo library permissions enabled. Any idea what I'm missing? I'm seeing the same error on iOS17.2 and iPadOS 17.2, with Xcode 15.2. Thanks for any tips ☺️
3
0
1.7k
Feb ’24
Failure accessing the Photo library when app is 1st installed on iOS 15.2
Context: Using Xcode 13.2 and building on iOS 15.2 devices When installing the app for the 1st time on a device or simulator. Issue: When building and installing an app that requests access to the user’s Photo library, Xcode logs a  [GatekeeperXPC] Failed to open photo library error even before the app requests photo library access. Xcode Log example: 2021-12-16 18:33:57.848222+0100 App[20166:691616] [GatekeeperXPC] Failed to open photo library Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization} 2021-12-16 18:33:57.848560+0100 App[20166:691616] [GatekeeperXPC] Got a bind failure for URL file:///Users/manuel/Library/Developer/CoreSimulator/Devices/F6302FEB-0448-4BAC-89A9-E34E8801B894/data/Media/, resetting bind state: <PLResult:0x600000cc5d40> failure: Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization} (previous result: (null)) 2021-12-16 18:33:57.849131+0100 App[20166:691616] [GatekeeperXPC] XPC connection error to assetsd getLibraryServiceWithReply: : Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization} 2021-12-16 18:33:57.849507+0100 App[20166:691616] [Backend] Swallowing proxy invocation: <NSInvocation: 0x6000019ede80> getLibraryServiceWithReply: CoreData: XPC:  Unable to create NSXPCConnection CoreData: fault: Something has gone badly awry initializing the XPC connection pool: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil 2021-12-16 18:33:57.855954+0100 App[20166:691616] CoreData: XPC: sendMessage: failed #0 After photo library access is granted, the Photos framework methods don't return any assets/albums etc. Nothing. Building for iOS 15.0 devices and Sims works fine. Anyone else seing this?
4
0
5.2k
Dec ’21