Created
December 10, 2019 12:39
-
-
Save PetreVane/9269da1359ec1e255eea4b02b91cbae9 to your computer and use it in GitHub Desktop.
Iterates over project resources, by getting a Bundle.main refeference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Testing: UIViewController { | |
let fileManager = FileManager.default | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
if let path = Bundle.main.resourcePath { | |
guard let items = try? fileManager.contentsOfDirectory(atPath: path) else { print("Path is not available"); return } | |
for item in items { | |
print("This item is: \(item.description)") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment