在 Objective-C 中,我正在做这个:
NSString *path = [[NSBundle mainBundle] pathForResource:@"LUIImages" ofType:@"bundle"];
path = [[NSBundle bundleWithPath:path] pathForResource:_imageHash ofType:nil];
但我似乎找不到在Swift 3中的等价物
let bundlePath: String = Bundle.main.path(forResource: "LiveUI", ofType: "bundle")!
但是接下来该怎么办呢?或者有更好的方法来加载自定义包吗?
Bundle(path: "...")?.path(forResource: "...", ofType: "...")
?- 尝试使用自动补全,它应该会指导你。 - Martin R