Swift - Video file array save to app gallery fine but not properly to the app document directory
It looks like the problem in these lines.
let fileName = String(self.videoURL)
let filePath = "\(documentsPath + "/ImportVideo")" + fileName
You're basically overwriting your video with the same fileName
because every time it takes some global scope variable self.videoURL
which I don't see chaining anywhere. Try to generate a unique file name for different videos for example using UUID
string
let fileName = UUID().uuidString
Save/create folder that it to be treated as a file with FileManager
Got it working. Seemed as old builds of my app was interfering with the system file types. So I searched for my app name and removed old builds from my computer. Then the system recognized my file suffix and opened it right away!
But I lost the icon this time, but that's another issue :)
iOS: Support App Group folders in local file provider
It's pretty simple: No. :(
We are struggling with the same issue and its simple: You can't participate in the files app (or iTunes File Sharing) if you don't store your files in the Documents folder.
It seems like this is not well thought out. You should not integrate as a file provider unless you are actually providing a file system such as dropbox, at least that's what we've been told at WWDC. On the other side you should support stuff like iMessage extensions, today extensions,... which only are possible if your files are accessible through an app group. But this then automatically breaks the use of the Files.app as well as iTunes Filesharing.
We filed radars for that, any duplicate would help, I guess.
iOS 13.1 (17A844) folder not available on Xcode 11
As a temporary measure until Xcode 11.1 is released,
this git repository has new and old device support files including 13.1!
https://github.com/iGhibli/iOS-DeviceSupport
Xcode 11.1 has since been released which contains the 13.1 folder.
Xcode(version 13.3.1) doesn’t support iOS 15.6
We can debug iOS(15.6) by using Xcode 13.4.1, which is not showing in release notes Xcode 13.4.1.
Where can I find the MyDocuments folder on iPhone Simulator?
See Building Great Document-based Apps in iOS 11.
If you want to see it in the files app, you’ll want to set the following value in your Info.plist
:
- “Supports Document Browser” (
UISupportsDocumentBrowser
)
Or
- “Application supports iTunes file sharing” (
UIFileSharingEnabled
); and - “Supports opening documents in place” (
LSSupportsOpeningDocumentsInPlace
)
Related Topics
C-Style Uninitialized Pointer Passing in Apple Swift
Differences Between Filtering Realm with Nspredicate and Block
Swiftui Share Sheet Crashes iPad
Swiftui - How to Get Coordinate/Position of Clicked Button
How to Apply a Grace Time Using Rx
Why Can't I Use Self in a Func Swift
Swift- How to Display Image Over Button
Applewatch Messages Url Works Hard Coded But Not with Variables
Avplayer Seektotime Not Working Properly
Selectively Remove and Delete Objects from a Nsmutablearray in Swift
Swift Repl: How to Save/Load the Repl State? (A.K.A. Suspend/Resume, Snapshot, Clone)
Computed (Nsobject) Properties in Swiftui Don't Update The View
How to Load Nsview from Xib with Swift 3
Gmail API: How to Send Attachments to The Drafts on Swift
How to Obtain a Swift Type from a String