How do you add a background color around each variable inside the interests variable? Just around text not the spaces.
var interests = \"\\(int01) \\(int02)
What you can do is use a UICollectionView with cells that have labels that span the entire cell. Each cell then corresponds to individual words. That way you can set either the label or the cell background color to whatever you want.
For ease of implementation, I would turn your interests
variable into an array of strings. That way you can easily count the number of cells you need and give each cell the right string.