xcasset

Xcode Image Catalogs: Image not showing in Interface Builder

*爱你&永不变心* 提交于 2019-12-05 12:25:23
So, the artist sent me a Resources.xcassets folder that I simply dragged into the project. I then jumped to interface builder, added a new UIImageView, assigned an image name from the xcassets, and to my surprise, I couldn't see the images. It shows as a blue question mark. Notice, that the IB autocomplete is working, and when I run the application, the assets actually show up! But not in interface builder, which makes laying the assets around virtually impossible, especially with the size to fit not working... Bug reported: 15733387 It seems I am at fault... I created a fresh new XIB, and

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

旧城冷巷雨未停 提交于 2019-12-04 05:26:26
问题 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 project. This puts the assets within the app's main bundle, and avoids this error when trying to use them via Interface Builder: Could not load the "ImageName" image referenced from a nib in the bundle with identifier "BundleName" My question, though,

Get Data from XCAsset catalog

扶醉桌前 提交于 2019-12-04 03:09:47
I understand that to get images from the asset catalog i can use UIImage(named: "fileName") to do it. however, what if i am getting DATA from the XCAsset catalog? I can't figure this out. I have tried, let url = NSBundle.mainBundle().URLForResource("fileName", withExtension: nil) let data = NSData(contentsOfURL: url!) But it is nil. I do not know how to get data from the XCAssets catalog. If anyone can help me out (googling hasn't helped) please let me know I will be very thankful! Update: Why am I trying to get data from an asset catalog? I dragged an animated gif into the asset catalog. And

Impossible to load an image in xcassets on bundle

我与影子孤独终老i 提交于 2019-12-03 19:56:07
问题 I need to include images in a static library. I created a bundle and inserted in my images, the problem is that it seems to work if I include the images directly in the bundle, but stops working if I put in a xcassets file. I followed many guides and searched for a solution on this site. The most popular solution is to insert this line of code: [UIImage imageNamed:@"MyBundle.bundle/imageName"] but it seems not work for me any ideas? 回答1: There are two ways to solve this, If your app is still

How can I load an image from Assets.car (compiled version of xcassets) within an NSBundle? (without using CocoaPods)

青春壹個敷衍的年華 提交于 2019-12-03 13:48:31
问题 We're getting these kind of error messages: Could not load the "iconStatus" image referenced from a nib in the bundle with identifier "com.company.OurResourceBundle". Basically, we put a bunch of images in the xcassets folder ( which works for non-bundle loaded cases ). The xcassets and nib files are packed into a resource bundle. When the app launches, uiimageview in the nib file cannot load any images with the above error message. [UIImage imageNamed:@"OurResourceBundle.bundle/iconStatus"]

Use of xcassets

我是研究僧i 提交于 2019-12-03 10:29:26
问题 Is .xcassets resource only for app icons and launch images or for our own image assets also? I do know that we can add our images to the .xcassets file, but is it good practice to do so? 回答1: Use of xcassets is the new standard as of Xcode 5 and iOS 7. Import images by clicking on the blue folder called "Images.xcassets" then click on the small "+" plus sign at the bottom of the window that appears. Now choose "Import" to put images in there. This is also the new location of the icon and

Xcode 10 app icon not showing

非 Y 不嫁゛ 提交于 2019-12-03 06:47:52
问题 Recently updated to Xcode 10 beta and my App that previously has correct icon displayed when built and ran from Xcode 9.4 to device now shows the default blank icon when running in Xcode 10. When opening AppIcon asset it shows icon correctly in all the placeholders without any warning icons. When tapping on new "Show Slicing" I do not see anything. Anyone any clues how to fix this so app icon shows? 回答1: On 6/19/18 Apple released Xcode 10. beta 2. Upgrading solved the problem I was having

How can I tell Asset Catalog (.xcassets) to use the Same Image for Multiple Image Wells?

懵懂的女人 提交于 2019-12-03 06:38:23
问题 We have several Xcode app projects, and we're upgrading all of them to use the latest Xcode 5 features, including Asset Catalogs ( .xcassets ). All of our default (launch) images already include spacing for the status bar, and we want to use these images for both the iOS 5,6 and iOS 7 launch images. Further, we don't want to include multiple copies of the same image in the project. One of our projects is correctly set to use the same images for both of these image well sets. However, this was

How can I load an image from Assets.car (compiled version of xcassets) within an NSBundle?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 05:13:57
问题 In a nutshell : How can I load images from a compiled Assets.car within an NSBundle ? Full Version: I'm in the process of converting a suite of apps to use CocoaPods . Each app relies on a shared pod called Core . Core includes code files, xib files, and several xcasset files. Here's the relevant line from the Podspec for Core that creates the resource bundle: s.resource_bundles = {'CoreResources' => ['Core/Resources/*']} The Podspec passes pod spec lint , and main project that relies on it

Use of xcassets

ぃ、小莉子 提交于 2019-12-03 02:03:11
Is .xcassets resource only for app icons and launch images or for our own image assets also? I do know that we can add our images to the .xcassets file, but is it good practice to do so? Use of xcassets is the new standard as of Xcode 5 and iOS 7. Import images by clicking on the blue folder called "Images.xcassets" then click on the small "+" plus sign at the bottom of the window that appears. Now choose "Import" to put images in there. This is also the new location of the icon and launch images instead of the standard target->general location, although this is where you still have the option