Regarding Marked As Duplicate - I don't think this is a duplicate because I'm not comparing an array to another existing array to get an order. Please see the answer I submitted to my own question for what I wrote to accomplish what I needed. This is an old question that I tried to improve with a better title.
I looked up sorting of arrays and I see how to reorder by alphabet or ascending dates or numbers, but I want to set a specific arbitrary order.
I have a group of .txt files in Bundle titled in a foreign non latin language (so I can't do alphabetical I think) and I load the titles into a tableview.
func loadStories() {
stories = Bundle.main.urls(forResourcesWithExtension: "txt", subdirectory: nil)!
}
so I have var stories: [URL] = [] and there are about 20 stories. How do I set the order into a specific order that has no alphabet/numerical logic? I want to just list the names in my preferred way of listing.
So I have a list of txt tiles that randomly populates my tableView - Story Ba, Story Bc, Story Ac, Story Cb, Story Ca, Story Aa, Story Bb.
I want it to populate the tableview in this specific order: Story Ba, Story Bb, Story Ac, Story Ca, Story Cb, Story Aa, Story Bc. There is no obvious logic to this order like alphabetical/numerical/etc so I can't use .sorted() or filter.
I'm looking to set the list to an arbitrary order that I can hardcode - how can I do this?