This time I share code in swift 4 how to split your string into an index and use that in textField, try this code below maybe can help you.

Buy me a coffeeBuy me a coffee