Answer the question
In order to leave comments, you need to log in
How to get non nil in file path in subfolders in Main Bundle?
Hey! There is a task to open browser games in WebView, which I copied into the project (see screenshot).
When I try to get the path of a file inside a folder, I always get path = nil:
let path = Bundle.main.path(forResource: "index", ofType: "html", inDirectory: "games/game1")
let path = Bundle.main.path(forResource: "index", ofType: "html")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question