For large media including images with size of ~10MB and videos of size ~200MB, iOS shows an preparing dialog and reduces the size of media.
Is there any way to skip this preparing step and get original media in share-extension for large files ?
Related
I have one big project that contains more then 22000+ images. and my ipa size is 400MB+
So I added On demand resource. it will working fine but after some time my downloaded assets purged by system...
So my question is:
1) Is any way to stop purged(cleaning) my downloaded asset which is automatic done system?
2) Is any alternate solution of on demand resource?
I would like to know if we were to put our images in the xcode Assets.xcasset or an image file could be enough?
Thank you
https://developer.apple.com/videos/play/wwdc2018/219/
From WWDC 2018:
"...for artwork that comes with your application, we strongly encourage you to use image assets. And there are a number of reasons why."
Some of those reasons:
"Image assets are optimized for name based and trait-based lookup. It's faster to look up an image asset in the asset catalog, than it is to search for files on disk that have a certain naming scheme."
"managing buffer sizes"
"...per device thinning, which mean that your application only downloads image resources that are relevant to the device that it's going to run on and vector artwork."
Vector artwork optimization: "...if your image gets rendered in an image view that is larger or smaller than the native size of the image it doesn't get blurry. The image is, actually, re-rasterized from the vector artwork... The asset catalog compiler has, actually, already produced a pre-rasterized version of that image and stored it in the asset catalog. So, rather than doing the complicated math of rasterizing your vector artwork into a bitmap, we can just decode that image that's stored in the asset catalog and render it directly into the frame buffer."
This is not an exhaustive list, click the link for more. So to answer the question, using the asset catalog is certainly not required, but it would be foolish not to use it for artwork that is delivered with the application for the reasons mentioned.
No. It is not required to use .xcassets files. You can also just add images and other resources to your Xcode project.
However I would always use Asset Catalogs if possible, because it gives you powerful features, such as using different images for different devices/gamuts/etc.
I am uploading PDFs from Dropbox/iCloud. But file sizes are like 50MB, 100MB. As of app requirement, there is no limit for file size to upload. How to reduce the file size before uploading to server?
You can use libHaru library to generate any kind of pdf. Try to reduce your pdf size while creating the pdf itself.
My app downloads images from an external resource to the Documents directory using FileTrasnfer.
Now, in one of the pages of my app I'm supposed to display those images.
The paths I used for the images is the exact path they were downloaded to,
then I don't understand why the images are not displayed, seems like there is no access to the files.
How can I access files in the Documents directory?
Anyone?
I am having a real hard time understanding how to embed many images and sounds in an iPhone app. When I say embed, I mean I want the images and sounds to be downloaded with the app, and some of those images will appear when the app is run. Other images are just saved in the app's disk space, so that when a user presses a button, the image or sound will be accessed and displayed or played.
I have read tutorials on using 'core data' and such, but that only seems like a way to create objects that can be used to reference such data items, or for storing small files as binary data. Can someone please tell me how in xcode I can specify a directory of images and .mp3s to be loaded onto a phone with my app, and how I can then call those media with code?
Some example code for the following would completely solve my problem:
An app is loaded onto a phone, and it contains 3 buttons. If the user presses button #1, a sound is heard. Button #2 plays a different sound, and button #3 changes a UIImageView to a different picture. (this isn't a homework assignment or something, but if I could code this example, I could do everything I need to in my app and understand the process)
Thanks!
I mean I want the images and sounds to be downloaded with the app
Simply add the images and sounds to your project. Make sure you specify (in the Add Files to Project dialog) that they are to copied into the project and that they are to be part of the target. The result will be that the images and sounds will be built into your app (in what is called its bundle, in particular the main bundle - see the NSBundle docs). You can then fetch them out, as needed, in code. For example, to fetch an image, use imageNamed:. To refer to a sound, refer to the file as a resource within the main bundle.
Other images are just saved in the app's disk space
That is a completely different matter. You will have to get the images from somewhere while the app runs. There is no way to have the user download the app and the image end up in the app's disk space: the app must populate its disk space, in real time, as the app runs. At the time the user downloads the app, the associated disk space, outside the app bundle itself, will be empty.
For images, see the responses to this question.
Sound is similar to images, but is loaded differently, this tutorial show how to load and play sounds.
For files that are saved after the app is installed, you will need to download and save those files in your code. For starters, see Apple's guide to the iOS file system