Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
319 views
in Technique[技术] by (71.8m points)

swift - Add mp3 files to an iOS app's internal storage from the files app

I'm trying to build a music player app in Swift and I want to be able to add mp3 files to the app's internal storage.

Right now I have a bunch of music files in the assets folder and i can play those files. I want to be able to add new files to the app from outside the app into that assets folder, copying the mp3 files from somewhere else, like the Files app for example.

Is there some kind of way to copy an mp3 file and add it to the assets folder of the app? Maybe it could be done using UIPasteboard?

question from:https://stackoverflow.com/questions/65883006/add-mp3-files-to-an-ios-apps-internal-storage-from-the-files-app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Why only Assets folder? you can use other folders to store your files, for example Documents (inside your app) and can create more folders inside. Look forward for FileManager class.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...