Reading the file which is bigger than iPhone RAM

Hi, I have a video file of about 4GB.
When I try to read the file by using the function Data(contentsOf: <URL>, options: <Data.ReadingOptions>). It will be leak memory and crash the app.
How can I control this issue?

How can I control this issue?

You usually do not load whole video content into a Data in iOS apps.
How do you want to use the video file?
Hi OOPer,

How do you want to use the video file?


I have a 4GB video file in external storage that I want to copy into my iPhone.

I have a 4GB video file in external storage that I want to copy into my iPhone.

Thanks for explanation. You have no need to load all the content when you want copy files.

I have a 4GB video file in external storage that I want to copy into
my iPhone.

Typically you’d do that using copyItem(at:to:).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Reading the file which is bigger than iPhone RAM
 
 
Q