How to make an iOS asset bundle?

前端 未结 7 603
谎友^
谎友^ 2020-12-02 05:37

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

My issue is that I\'m using a CATiledLayer with about 22,000 tiles for

7条回答
  •  感动是毒
    2020-12-02 05:46

    Here are the steps to create an asset or resource bundle (ex. FrameworkResources.bundle) - it's surprisingly non-obvious. This is especially useful if you are creating static frameworks.

    1. Press File -> New -> Target in Xcode
    2. Select "macOS" tab, search "Bundle"
    3. Tap "Bundle" -> click "Next" -> type product name "MyResources" -> tap "Finish"
    4. Go to "Build Settings" for the newly created Bundle. Change "Base SDK" (SDKROOT) to "iOS'
    5. Go to "Build Phases" for the newly created Bundle. Delete "Compile Sources" and "Link Binary With Libraries" (this will remove the executable within the bundle which can cause all sorts of build and app submission errors)

提交回复
热议问题