How to use Vectors in Xcode 8 - ios

I'm looking for solution of problem that I get image from my server and that image will be only be one(not for compatible all devices) and that image will also use in android device too so as you know android support SVG but iOS isn't (that 1 image should be use on all iOS devices even on iPad too). I look into this Tutorial and this use from PDF and also use local pdf.
So what will be approach from iOS end or server end to download 1 image (with one size) and will be show on all devices.
Looking for suggestions and help to resolve this issue.

You can try to implement PocketSVG (https://github.com/pocketsvg/PocketSVG) to do that.
There is one downfall though: it only supports SVG features that can be drawn using CGPaths or UIPaths.

Related

Horizontal planes not detected in Iphone SE

I have been working on Arkit applications these days and have tested many of these applications using Iphone 8 and Iphone X.
I have downloaded a project from Github - https://github.com/max6363/measure-using-ARKit-iOS11.
Though, in the project read me section, the developer mentioned that it is compatible with IPhone SE, my mobile is not able to detect any horizontal planes and as a result of this, I am not able to create any point in the space.
Could someone please let me know regarding this.
I would like to know,if I need to make any changes to the project.
Thanks in advance!

iOS Firebase Image #2x #3x

I have search all over internet, and cant find a solution.
How do you deal loading images from Firebase to support iOs #2x and #3x resolutions?
I know how to load an image from Firebase but not how to handle the different resolutions Issue.
A possible solution is to retrieve the PDF version of the resource a SVG version of it and manipulate it in iOS. Actually you cannot convert on the fly this kind of file, you need to convert it...

Which image format i should for ios development native ? SVG or PNG?

I am into iOS development from past 1+ months and what I have experienced is that I have to put images for 1x 2x 3x for iphone and then 2x retina for ipad. One of the experienced designers has sugguested to me to go for svg format as it scales itself according to the screen sizes.
So my elaborated questions are:
Can I use svg instead of png?
Is it necessary to still put images in 2x and 3x for iphone and ipad if I'm using svg?
Will the images in svg scale according to the phone size and not lose quality?
If any other information according to your experience please share.
Thank you.
Official iOS Dev documentation says "the PNG format is the one most recommended for use in your apps". You can read it for a lot more information here.
Yes, although the supported file types table doesn't list it. Apple values user experience. SVG scaling consumes a few more CPU cycles which they don't like. PNG rendering is more efficient than SVG.
Yes, Apple explicitly recommends using multiple versions of the image at different sizes. Then scaling can be done from the file having the nearest dimensions.
Refer 1. There are cases like zoom-in / out scenarios where SVGs would be better though.
You could use vectorized PDFs alternatively. You can read more here. It isn't without limitations, but with vectorized PDFs, Xcode automatically generates scaled versions. That should make life easier. Note that sometimes the scaled results look quite poor.

Photo Size and Resolution for iOS app

I am working on an iOS application that will show photos either in full screen or in frames in various sizes - like product catalog.
I know I am supposed to use images.xcassets to make things simple and I know I am supposed to create more than one version of the same photo in different sizes.
All I can find is AppIcon and LaunchImage guidelines. What would be the rules I should follow preparing photos to show in different devices? Sizes, resolutions?
Sample: I have 2048 x 1536 raw sized photo (even bigger ones). When it comes to prepare it for iOS app (will work both in iPad and iPhone), what are the dimensions to export my photos from PhotoShop? What would be the biggest sized version?
Could someone please show me a starting point to understand this?
Thanks in advance.
This design guidelines guide is very good. You will find everything you have to know about sizes.
But the simplest way is to use a tool like Asset Catalog Creator to generate your assets. Just drop your original image in it, select your #1x size, and it will generate the catalog for you, for all sizes.
Here is a screen size reference for iPhone devices you may find helpful. Here's one for iPads.
Additionally, if you've got a lot of files you need to resize that you've already exported, you might consider using ImageMagick for batch resizing.

Animation Lags on iOS devices for apps designed in Adobe Flash Pro

I am developing iOS app and android app using adobe AIR and Flash CS6.The app contains lots of animations. Since Bitmap images do not give a good quality, I have kept the images in Vector form only. It runs fine on android devices but when I publish it on iOS device many animation lags. How can I solve this without affecting the quality of my animations? I am using AIR SDK version 4.0 and GPU rendering method. Any help would be appreciated.
There might be a few things you could try:
use TweenMax/TweenLite for your animations as the GreenSock library is optimized for performance
try setting cacheAsBitmap to true on the vector you're animating
convert vectors to cached bitmap data (http://esdot.ca/site/2012/fast-rendering-in-air-cached-spritesheets)
try see if using "direct" mode for rendering yields better performance; from what I've experienced GPU is not well suited for vectors

Resources