Question: On Xcode, using Swift. I want to take an english word from a textbox and search for it in an array of objects containing an

On Xcode, using Swift. I want to take an english word from a textbox and search for it in an array of objects containing an attribute of the word. For example...

struct Word { var arabic: String = "something in arabic" var english: String = "something" }

var Apple = Word()

I'm going to have many english words with corresponding arabic words, so I want to do a binary search when the user types an english word in a text box to find the arabic version of it. When Apple.english is typed, I need to find Apple.arabic. So I need a binary search to search through all Word objects and looking at the .english attribute of each word object, if found it spits the corresponding .arabic attribute of the same Word object.

Help would be greatly appreciated!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!