initWithBundlePath now works as expected. the path passed to this will be loaded.
withResourceBundlePath is new, provide a bundle resource path where assets/images should be loaded. It is still on component authors, to ensure they are looking for resources.
Authors should do a fall through like so
// check main bundle/xcassets for an image to load
image = [UIImage imageNamed:source];
// no image loaded, check resourceBundlePath
if(image == nil) {
NSString* resourceBundlePath = [[[SyrRaster sharedInstance] bridge] resourceBundlePath];
NSBundle* bundle = [[NSBundle alloc] initWithPath:resourceBundlePath];
image = [UIImage imageNamed:source inBundle:bundle compatibleWithTraitCollection:nil];
}
Syr can now use dynamic paths for JS Bundles, as well as Dynamic paths for Resources on iOS.
How this works.
[[SyrRootView alloc] initWithBundlePath:filePath initialProperties:appProps withResourceBundlePath:pyplBundlePath];
initWithBundlePath
now works as expected. the path passed to this will be loaded.withResourceBundlePath
is new, provide a bundle resource path where assets/images should be loaded. It is still oncomponent
authors, to ensure they are looking for resources.Authors should do a fall through like so