Questions tagged [xcasset]

An image asset catalog is an asset management file type and editor in Xcode 5.

Xcode 5 asset catalogs manage images and icons in multiple resolutions. An asset catalog is a new asset management file type and editor in Xcode 5.

You use asset catalogs to store and manage images for different platforms, devices, and scale factors. The catalog presents the image variants required, and provides you with the ability to define slice and stretch points for images that are resized at runtime.

For more information on Xcode Asset Catalogs, refer here.

234 questions
7
votes
4 answers

Can I access an xcassets directory on the filesystem?

I would like to dynamically load all images in an xcassets directory. The files are named StockPhoto# where # is the number in the list. If I can access my StockPhotos.xcassets at runtime to count all the files in the directory, I won't have to…
user
  • 3,272
  • 7
  • 27
  • 66
7
votes
2 answers

Path Parameter in UIImage imageWithContentsOfFile: for XCAsset

Is there any way to retrieve a UIImage object with imageWithContentsOfFile: if the image is stored in an xcasset Bundle (Xcode 5 Image Catalog)? It's easy to access it with the imageNamed: method, but imageWithContentsOfFile: has a slightly…
Sam Spencer
  • 8,158
  • 12
  • 70
  • 130
7
votes
3 answers

storyboard has question marks for every image after I imported into xcassets

all images in my storyboard are now ? images. This happened after I imported all media assets into a new .xcassets structure. The app runs fine and the images show when the app runs, but what can I do to restore them in the storyboard?
Mark W
  • 3,769
  • 2
  • 34
  • 52
6
votes
1 answer

Error trying to add SVG image to xcode assets

I have converted an image from PNG to SVG using the vectorizer.io website. The SVG image looks fine when viewed with the Chrome browser and in GIMP. But when I try to add it to the asset folder in xcode (Version 11.4.1) I get this error ... The SVG…
Melchester
  • 173
  • 1
  • 13
6
votes
0 answers

Xcode doesn't correctly handle named colors defined outside the Main bundle

The main goal is to create a module (framework) containing the basic UI components to be used into multiple Apps of the same company, but I have some issues with Xcode badly handling Assets (especially Named Colors supporting Dark and Light…
lechuckcaptain
  • 979
  • 1
  • 8
  • 23
6
votes
1 answer

What does Auto Scaling do in Xcode 10 xcasset image properties

Found new option on xcasset catalogue image property in Xcode 10 called "Auto Scaling". What does this property do? Is it in any way related to Resizing: "Preserve Vector Data" when using PDF vector assets?
Vlad
  • 4,915
  • 3
  • 32
  • 56
6
votes
2 answers

Git not tracking a file from a folder - contents.json from .xcassets

I have checked almost all the questions on SO but nothing has worked for me. The issue that I'm unable commit the Contents.json file of .xcassets whatsoever. Whenever I add new images to .xcassets the source control does list the images but not the…
Adeel
  • 2,066
  • 1
  • 17
  • 28
6
votes
2 answers

Getting launch image from xcassets file has wrong size

Xcode's default Images.xcassets file has a slot for LaunchImage, where for a portrait iPhone app there are 5 possible slots. According to the documentation, to get an image properly sized from the xcassets file, just use [UIImage…
Snowman
  • 29,431
  • 43
  • 165
  • 290
6
votes
1 answer

Using xcassets images as src for img tag in a UIWebView web page

Xcode 5 introduced the possibility to manage all your images in a single assets file, instead of having a bunch of png variants hanging around. It works great with IB and Cocoa code, but when I try to reference the pictures from an embedded html,…
KPM
  • 10,201
  • 3
  • 41
  • 63
5
votes
1 answer

Does Both Referencing an Asset Catalogue and Including it from a Framework Create Duplication?

As discussed here & here, the only apparent way to host re-usable images in a Framework's .xcassets file, then use those images in the storyboard / XIB of an app, is to manually create a reference to that catalog file directly within the app's…
TheNeil
  • 1,985
  • 2
  • 17
  • 36
5
votes
2 answers

Can't programmatically change color set in storyboard as color from xcassets catalog

When I set color of some property in Storyboard (for example textColor of my UILabel) as color created as New Color Set in xcassets catalog then I can't programmatically change this color on the first attempt: label.textColor = UIColor(named:…
Robert Dresler
  • 10,121
  • 2
  • 15
  • 35
5
votes
1 answer

Getting images from Cocoapod's xcassets doesn't work

I am using the 1Password Pod and the GCast pod and they both have xcassets files with the assets they want you to use. When I create a button in IB and assign it the name of one of the images in the xcassets file, the correct image shows up but on…
Mark Bourke
  • 9,052
  • 7
  • 21
  • 29
5
votes
1 answer

Assets.xcassets in Watch Extension in WatchOS 2

What is the purpose of Assets.xcassets in Watch Extension in WatchOS 2? What images should be included in these assets?
qwerty
  • 211
  • 2
  • 10
5
votes
3 answers

Xcode 7 beta 4 build error - com.apple.CoreSimulator.SimRuntime.iOS-9-0

The error I get when building a previously working project: Images.xcassets: Failed to find a suitable device for the type SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-2 with runtime SimRuntime : 9.0 (13A4305g) -…
Mezzo
  • 85
  • 1
  • 5
5
votes
1 answer

Do I really have to explicitly support iPhone 6 and iPhone 6 Plus screens?

I couldn't get used to introduced in Xcode 6 new layout system called Size Classes, so I decided to go by the old way creating two separate xibs for iPhones and iPads with ~iphone and ~ipad suffixes correspondingly. Xibs designed for iPhones (with…
nalexn
  • 9,528
  • 6
  • 39
  • 45
1 2
3
15 16