Accessing Resources in Swift PlaygroundBook

48 Views Asked by At

I am having trouble accessing images which I have stored in a sub directory in the PrivateResources Folder of my Swift Playgroundbook. I'm trying to access the following images. I have tried Bundle.main.path(forResource: "img_1", ofType: "jpg", inDirectory: "trainingSample/0"), Bundle.main.urls(forResourcesWithExtension: "jpg", subdirectory: "trainingSample/0"), and Bundle(for: type(of: self)).path(forResource: "trainingSample", ofType: nil) but they all return either empty arrays or nil. Could someone help me out? Thanks in advance! images I'm trying to access

0

There are 0 best solutions below