如何制作iOS资产包? [英] How to make an iOS asset bundle?

查看:132
本文介绍了如何制作iOS资产包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我评估的iOS项目中看到了一个自定义资产包,所以至少我知道它是可能的。

I saw a custom asset bundle in an iOS project I evaluated, so at least I know it's possible.

我的问题是我正在使用CATiledLayer对于给定的图像,大约22,000个图块,编译需要很长时间(半小时清洁构建,常规构建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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆