on-demand-resources

iOS/Xcode enable On Demand Resources for Frameworks in project

偶尔善良 提交于 2020-01-02 06:44:07
问题 Has anyone built a project that has Enable On Demand Resources set to YES for frameworks linked to the project. Most of the catalog assets in the app I'm working on are kept and brought into the project in frameworks and I get build error Target '<Framework/Bundle>Name' has on-demand resources enabled (ENABLE_ON_DEMAND_RESOURCES = YES), but it is not supported for framework target types. and unable to compile the project. 来源: https://stackoverflow.com/questions/52211539/ios-xcode-enable-on

How to detect where the on demand resources are located after being downloaded?

吃可爱长大的小学妹 提交于 2019-12-29 09:17:12
问题 I implement the app thinning in my project by getting the reference from below two answers:- https://stackoverflow.com/a/33145955/988169 https://stackoverflow.com/a/31688592/988169 How to detect where the on demand resources are located after being downloaded? 回答1: Unless you specified a bundle when you initialized the resource request, the resources are placed in the main bundle by default. So for example, you could access them this way, if appropriate to your type of resource: NSString

Getting video from Asset Catalog using On Demand ressources

和自甴很熟 提交于 2019-12-22 08:57:06
问题 I attributed to my .mp4 video the "tokyo" tag for example, and set it as installed during the app installation. Now before I was using a Path to get it from my resources, now it's different because it's located on the Asset Catalog. After found documentations, I tried something like : NSBundleResourceRequest(tags: ["tokyo"]).beginAccessingResourcesWithCompletionHandler { (error) -> Void in let tokyoVideo = NSDataAsset(name: "tokyo") So I can do : tokyoVideo.data to access NSData but I'm using

accessing and downloading on demand resources iOS9

半城伤御伤魂 提交于 2019-12-20 01:11:34
问题 I am trying to implement new iOS9 feature app thinning, I understood how tag an image and enable on demand resource in Xcode 7 but I don't understand how to implement NSBundleResourceRequest in my app, can someone help me, that would greatly appreciated 回答1: First, check if the resources are available. Else download them. Here is the swift code I use let tags = NSSet(array: ["tag1","tag2"]) let resourceRequest = NSBundleResourceRequest(tags: tags as! Set<String>) resourceRequest

On Demand Resources “0 Asset Packs”

一个人想着一个人 提交于 2019-12-13 15:27:37
问题 I recently started implementing On Demand Resources to my app. Everything is fine and dandy when I deploy the app to my phone from Xcode. But when I upload the binary to iTunes Connect it says "0 Asset Packs": The asset tags in Xcode look fine: Here's what the build settings of Assets looks like: I'm testing via TestFlight and in the app I get an error saying "The requested application data doesn't exist." I tried the following: Removed / readded the resource tags in Xcode Uploaded 3 slightly

NSBundleResourceRequest bundlePath

☆樱花仙子☆ 提交于 2019-12-11 11:07:16
问题 [UPDATE AT THE END OF THE QUESTION] I use to play some audio files in my app. I used to store the files in the app, but then I moved to On Demand Resources and NSBundleResourceRequest . I have an IBAction to play a random file, and since I moved to ODR , it is not working. The only thing I changed was NSString *bundleRoot = [[NSBundle mainBundle] bundlePath]; (line 3) NSBundleResourceRequest *request1; - (IBAction)randomPlay { NSString *bundleRoot = [[request1 bundle] bundlePath];

Can iOS 9 on-demand resources be kept permanently?

放肆的年华 提交于 2019-12-09 15:00:17
问题 According to the documentation, iOS 9 on-demand resources downloaded through a NSBundleResourceRequest are kept only until endAccessingResources is called, and it is called automatically when the resource request object is deallocated . Okay, but when the app terminates, everything is deallocated. So does this mean that resources downloaded using a NSBundleResourceRequest don't survive termination of the app? I was hoping to use a simple strategy of making my app smaller for download from the

iOS/Xcode enable On Demand Resources for Frameworks in project

情到浓时终转凉″ 提交于 2019-12-05 19:27:34
Has anyone built a project that has Enable On Demand Resources set to YES for frameworks linked to the project. Most of the catalog assets in the app I'm working on are kept and brought into the project in frameworks and I get build error Target '<Framework/Bundle>Name' has on-demand resources enabled (ENABLE_ON_DEMAND_RESOURCES = YES), but it is not supported for framework target types. and unable to compile the project. 来源: https://stackoverflow.com/questions/52211539/ios-xcode-enable-on-demand-resources-for-frameworks-in-project

Getting video from Asset Catalog using On Demand ressources

大城市里の小女人 提交于 2019-12-05 12:30:32
I attributed to my .mp4 video the "tokyo" tag for example, and set it as installed during the app installation. Now before I was using a Path to get it from my resources, now it's different because it's located on the Asset Catalog. After found documentations, I tried something like : NSBundleResourceRequest(tags: ["tokyo"]).beginAccessingResourcesWithCompletionHandler { (error) -> Void in let tokyoVideo = NSDataAsset(name: "tokyo") So I can do : tokyoVideo.data to access NSData but I'm using AVPlayer which take in parameter an NSURL, not data. So what can you suggest me for getting a NSURL of

On demand resources in iOS 9 - how to find out exact location of downloaded resources?

廉价感情. 提交于 2019-12-03 16:59:56
I'm trying to use ODR in my game which doesn't use xcassets. So, I've got a texture with a tag (e.g. "tutorial"), made it ODR in project settings and used the code below the get it downloaded: NSBundleResourceRequest *resourceRequest = [[NSBundleResourceRequest alloc] initWithTags:tags]; [resourceRequest conditionallyBeginAccessingResourcesWithCompletionHandler:^(BOOL resourcesAvailable) { if (resourcesAvailable) { // Upload the texture } else { [resourceRequest beginAccessingResourcesWithCompletionHandler:^(NSError * _Nullable error) { if (error) { NSLog(@"Failed to load assets pack"); } else