Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

398
Views
How to change file extension using swift?

I'm using swift code but is not changed file extension.

This my swift code

let url = NSURL(fileURLWithPath: outputURL.path).deletingPathExtension?.appendingPathExtension("mp3")
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You are just creating a URL and then changing that URL. You are not actually operating on any file.

To rename a file, call FileManager.default.moveItem(at:to:). Pass the file URL as the first argument, and the file URL with the new name as the second argument.

let newURL = outputURL.deletingPathExtension().appendingPathExtension("mp3")
try FileManager.default.moveItem(at: outputURL, to: newURL)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!