I'm fairly new to swift but I'm trying to access a folder's content that I've put in a "Resources" group folder WHILE using the path as a NSURL. I was thinking of using "fileURLWithPath" But I'm not entirely too sure. Here is the file path /Users/userName/Desktop/myapp/myapp/Resources/
In run time, app will use its own data container, not your Desktop.
/Users/userName/Library/Developer/CoreSimulator/Devices/.../data/Containers/Bundle/Application/.../YourAppName.app
So, you have to copy the files into your project. And you can get your file this way ..
// Swift 3
let files = Bundle.main.paths(forResourcesOfType: "mov", inDirectory: nil)
print(files.count)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With