I’ve an Xcode challenge with the next construction:
projectName
│
└── Part
│
└── Property
│
├── subfolder
│ ├── subfolderA
│ ├── subfolderB
│ ├── subfolderC
│ ├── subfolderD
│ ├── fileA
│ ├── fileB
│ ├── fileC
│
├── fileD
├── fileE
├── fileF
...
I have to get the URL to fileA
and subfolder
itself.
I can reliably get the URL to fileA
like this:
personal var fileURL: URL? = Bundle.fundamental.url(forResource: "fileA", withExtension: "js")
How do I get the URL or path for subfolder
? I’ve tried a number of issues like this:
personal var subfolderURL: URL? = Bundle.fundamental.url(forResource: "subfolder", withExtension: nil)
However it returns nil
.
I do know the sources are within the bundle and have confirmed in Construct Phases > Copy Bundle Sources.
When the app is operating on my simulator, if I print the fileURL
, it’s one thing like this:
~/Library/Developer/CoreSimulator/Gadgets/{UUID}/knowledge/Containers/Bundle/Software/{UUID}/{AppName}.app/fileA.js
So it looks like the sources are being flattened at runtime.
I am utilizing a WKWebView
and inside it including some HTML with a <script>
factor that wants the subfolder
URL:
require.config({
paths: { 'subfolder': '(subfolderURL)' }
});
The script expects that folder and its information in a sure construction, so I do not assume I can simply specify the sources individually.
Is there any method to do that?
Right here is an analogous query from some time again. The reply has little or no info and a damaged hyperlink that supposedly solved the entire subject.
Notice: subfolder
is a blue folder (reference, not group) within the Venture Navigator. In Construct Phases > Copy Bundle Sources, neither subfolder
itself nor any of the folders inside it present up as line gadgets, however all their contained information do. For instance, there’s a line merchandise for fileA.js ...in projectName/Part/Property/subfolder
, or someFile.js ...in projectName/Part/Property/subfolder/subfolderA
.
I am utilizing Xcode 16.2.