Border around every word of UILabel

后端 未结 4 593
天命终不由人
天命终不由人 2021-01-07 09:06

Is there a way i can draw border around every word of UILabel. Suppose UILabel contains the string \" This is the Line 1\".

I want 5 differ

4条回答
  •  臣服心动
    2021-01-07 09:55

    SWIFT 5. Alternative solution

    The Solution Logic

    1. Converting Strings to Labels
    2. Customizing Labels
    3. Converting Labels to Images
    4. Converting Images to Attributed text
    5. Creating TextView
    6. Setting Attributed text to TextView

    You can find implementation here:

    https://github.com/vivatum/WordsAsTagLabels-Example

提交回复
热议问题