Use vector artwork for iOS launch image in asset catalog?
Asked Answered
B

2

7

Is this possible? It looks like I am going to need 9 different launch images, so replacing them all would be a bit of a chore.

Bagging answered 10/10, 2014 at 20:36 Comment(1)
Now we can use PDF vector image for launch screenGarbage
V
5

Unfortunately, I think you can't use vector artwork for ALL of your LaunchImages... ... but there's an approach which makes our lives easier: the new LaunchScreen.xib.

In File > New, you create a new Launch Screen in User Interface: Creating Launch Screen

Now, you can set the new Launch Screen File in your project's target: Setting your new Launch Screen

In this LaunchScreen.xib you can put your vector artwork, using AutoLayout for adapt your vector to all screen sizes.

Why I told that you can't use vector artwork for ALL sizes? Because it only works in iOS 8+. For iOS 7, I created the PNG image and I put this in LaunchImage asset catalog, in the old way. LaunchImage iOS 7

PS: I tested this approach only in simulator.

Venal answered 21/10, 2014 at 0:55 Comment(3)
It's been a year, but can you elaborate on how you did this or upload the project somewhere? Did you load an SVG into a UIWebView in the LaunchScreen.xib? Did you use vector PDFs in an UIImageView to generate compile-time PNGs?Gilgai
1) Import vector PDFs to project (how to do it: martiancraft.com/blog/2014/09/vector-images-xcode6) 2) Implement LaunchScreen.xib (named by Apple as "Launch File") for iOS8+. Drag and drop UIImageView for LaunchScreen.xib and simple set vector PDF in Image property 3) Older iOS (iOS 6.1 for iPod 4th and iPhone 3GS; iOS 7.1 for iPhone 4) you need design Launch Image .PNG in old way. Add a LaunchImage in your Image.xcassets and uncheck "iOS 8.0 and Later".Boyer
We can use PDF vector image for launch screenGarbage
S
1

Yes, you can do this with XCode 6. This is a new feature added with the new release.

The Session 441 from WWDC 2014 give you more information about this way :)

  • Make a new image set
  • Click on the blank image set
  • Choose vector into attributes inspector. Now you have a universal image !
  • Drag your vector into this universal slot ;)

Enjoy !

Simplism answered 10/10, 2014 at 20:45 Comment(2)
But is it a launch image?Bagging
It is not. No vector option for LaunchImage's (yet?).Fellini

© 2022 - 2024 — McMap. All rights reserved.