I have an image file named "Image.png", and it is saved in my main bundle (right beside the ViewController.swift file in the Project Navigator hierarchy). I want to save a copy of this image to the temporary directory. I've never done it before, what code could I use please?
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Use savefig in Python with string and iterative in
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Where does this quality loss on Images come from?
Something like this should do the trick. I'm assuming you wanted the answer in Swift.
Although, I'm not really sure why you would want to do this rather than directly accessing the bundle resource.
Swift 4.x version of mszaro's answer