NSAttributedString with image attachment and NSTextTab, text not aligned
<p>I'm trying to have a UIlabel with an image and title on the left and a list of descriptions with bullets on the right.</p>
<p>To do that I'm using NSAttributedString like this :</p>
<pre><code>NSMutableParagraphStyle *pStyle = [[NSMutableParagraphStyle alloc] init];
pStyle.tabStops =
    @[ [[NSTextTab alloc] initWithTextAlignment:NSTextAlignmentLeft location:tabLocation options:[NSDictionary dictionary]] ];

NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] init];
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
textAttachment.image = [UIImage imageNamed:@&quot;test_image&quot;];
textAttachment.bounds = CGRectMake(0, -3, 15, 15);//resize the image
attString = [NSAttributedString attributedStringWithAttachment:textAttachment].mutableCopy;
[attString appendAttributedString:[[NSAttributedString alloc]
                                      initWithString:[NSString stringWithFormat:@&quot;title\t\u2022 %@&quot;,
                                                                                [@[ @&quot;description1&quot;, @&quot;description2&quot; ]
                                                                                    componentsJoinedByString:@&quot;\n\t\u2022 &quot;]]
                                          attributes:@{NSParagraphStyleAttributeName : pStyle}]];
label.attributedText = attString;
</code></pre>
<p>I expect the list on the right to be left aligned but that's not the case, here is the result I get:</p>
<p><a href="https://i.stack.imgur.com/0ijNf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0ijNf.png" alt="enter image description here" /></a></p>
<p>What I expect is the list to be aligned like this:</p>
<p><a href="https://i.stack.imgur.com/dBRXQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dBRXQ.png" alt="enter image description here" /></a></p>