Strikethrough horizontal line with words in the middle Swift iOS

380 Views Asked by At

I am trying to get this done using AttributedString.

Is there a way to have horizontal line with words in the middle?

I need similar to this

1

There are 1 best solutions below

1
On

you can achieve this by using three label with auto-layout

enter image description here

i give constraint to center label(Today 08.30) center horizontal and center vertical to viewcontroller.

enter image description here

just change the Hugging Priority of center label(Today 08.30) to 1000 enter image description here

now your center label adjust his width accoding to your text.

give backboard color to other two label.