Use of xcassets

ぃ、小莉子 提交于 2019-12-03 02:03:11

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 to not choose "Don't use asset catalogs".

It's really helpful because you'll only see 1 image name instead of duplicate names with extensions like "@2x" and "-568h@2x".

Apple said that the asset catalog editor in Xcode manages your app’s images, grouping together various resolutions of the same asset. When building, Xcode compiles the asset catalog into the most efficient bundle for final distribution.

So basic asset catalog can manage AppIcon and LaunchImage.

But you can also add new images to new folders as below.

late to the party but yes it is the best practice

and also There is one tool : AVXCassets Generator with which you can directly generate XCAssets file for all your icons and images just by one click.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!