I have two ViewController: First:
@property (nonatomic, strong) NSBundleResourceRequest *resourceRequest ;
- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSSet *tags1 = [NSSet setWithObjects: "1","2","3","4","5", nil];
self.resourceRequest = [[NSBundleResourceRequest alloc] initWithTags:tags1];
self.resourceRequest.loadingPriority = 0.95;
[self.resourceRequest conditionallyBeginAccessingResourcesWithCompletionHandler:
^(BOOL resourcesAvailable)
{}}];
}
and second:
@property (nonatomic, strong) NSBundleResourceRequest *resourceRequestCurrent ;
- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSSet *tags2 = [NSSet setWithObjects: "5", nil];
self.resourceRequestCurrent = [[NSBundleResourceRequest alloc] initWithTags:tags2];
self.resourceRequestCurrent.loadingPriority = NSBundleResourceRequestLoadingPriorityUrgent;
[self.resourceRequestCurrent conditionallyBeginAccessingResourcesWithCompletionHandler:
^(BOOL resourcesAvailable)
{}}];
}
I open first View, then go to second, but I see that tags2 with PriorityUrgent downloaded after tags1.