-2

I have a BIG folder with dozens of folders inside, with a couple of audio files inside each folder.

I need to get the count of audio files in every one of those sub folders (e.g. AppName/AudioFiles/ThirdFolder/(I need the count of all the audio files here)).

I have tried a lot of different ways of doing this, and I think my problem is that the folders (Groups) aren't there; somehow.

Mohit Kumar
  • 1,789
  • 1
  • 14
  • 22
  • 1
    Can you share more info like a screenshot or the code that you have tried? – Mohit Kumar Feb 01 '20 at 05:58
  • @MohitKumar Here is one of the things I tried `let AudioArray = Bundle.main.urls(forResourcesWithExtension: "mp3", subdirectory: nil) as [URL]?` But I can't change the subdirectory to anything but nil, or it will crash. – BugWarrior Feb 01 '20 at 06:15

1 Answers1

0

I have figured it out, it was because folders (Groups) aren't recognized. You need to make them reference folders, to do that, when you drag your folders into your project manager, make sure you press "Create folder references", and NOT "create folder groups".