Post

Replies

Boosts

Views

Activity

Reply to Easy access to files saved inside documentDirectory
You can alway add     #if targetEnvironment(simulator)         print("Documents Directory:\n\(URL.documentsDirectory.path())")     #endif somewhere in the initialization of your app code and print the path to the console. Or use the following app https://github.com/twostraws/ControlRoom for additional features the simulator should have, including access to the documents directory and the directory where the Files App stores its data.
Nov ’22
Reply to Sorting Array of Dictionaries with Exceptions?
This should be possible by adjusting your sort condition. Instead of lValue.categoryName < rValue.categoryNameyou could write something like this: (lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName or !(lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName This is not correct code yet and I didn't validate the conditions, but I hope you get the idea. lValue.categoryName < rValue.categoryName is the sort condition the .sort-function uses to decide in which order the elements should appear. You can use very complex conditions or even a function deciding the order of two items by returning true or false depending on the order you want the two compared elements to appear.
Sep ’22