如何制作 iOS 资产包? [英] How to make an iOS asset bundle?
问题描述
我在评估的 iOS 项目中看到了一个自定义资产包,所以至少我知道这是可能的.
I saw a custom asset bundle in an iOS project I evaluated, so at least I know it's possible.
我的问题是,我对给定的图像使用了具有大约 22,000 个图块的 CATiledLayer,编译需要很长时间(干净构建半小时,常规构建需要 5-10 分钟).因此,我想获取所有图像并制作一个自定义包以使其可移植,并且希望不会每次都重新编译到应用包中.
My issue is that I'm using a CATiledLayer with about 22,000 tiles for a given image and it takes a very long time to compile (half an hour clean build, 5-10 minutes for regular build). So, I want to take all of the images and make a custom bundle to make it portable and hopefully not recompile into the app bundle each time.
我该怎么做?我检查了文档,但没有看到有关如何实际创建包的解释.
How do I go about this? I checked the docs, but didn't see an explanation on how to actually create the bundle.
推荐答案
答案很简单
在finder中创建一个文件夹,向其中添加文件,将其重命名为bundlename.bundle
Make a folder in finder, add files to it, rename it to bundlename.bundle
拖入 Xcode - 成功!
drag into Xcode - success!
访问,使用PathToMainBundle+"/bundlename.bundle"的形式
to access, use the form of PathToMainBundle+"/bundlename.bundle"
这篇关于如何制作 iOS 资产包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!