title: NSAttributedString bullet list issues
body: <p>I am trying to create a bullet list using <code>NSAttributedString</code> and <code>UITextView</code>. And, here is what I was able to achieve so far:<a href="https://i.stack.imgur.com/syLW8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/syLW8.png" alt="enter image description here"></a></p>
  
  <p>As one can see, there is a small "shift" between two lines. Here is a fragment of code which I use to build attributed string:</p>
  
  <pre><code>func add(bulletList strings: [String],
           indentation: CGFloat = 15,
           lineSpacing: CGFloat = 3,
           paragraphSpacing: CGFloat = 10) {
  
      func createParagraphAttirbute() -&gt; NSParagraphStyle {
          var paragraphStyle: NSMutableParagraphStyle
          let nonOptions = NSDictionary() as! [NSTextTab.OptionKey: Any]
  
          paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
          paragraphStyle.tabStops = [
              NSTextTab(textAlignment: .left, location: indentation, options: nonOptions)]
          paragraphStyle.defaultTabInterval = indentation
          paragraphStyle.firstLineHeadIndent = 0
          paragraphStyle.lineSpacing = lineSpacing
          paragraphStyle.paragraphSpacing = paragraphSpacing
          paragraphStyle.headIndent = indentation
          return paragraphStyle
      }
  
      var buffer = NSMutableAttributedString.init()
  
      for string in strings {
          let formattedString = "\u{2022} \(string)\n"
          let attributedString = NSMutableAttributedString(string: formattedString)
          let paragraphStyle = createParagraphAttirbute()
  
          attributedString.addAttributes(
              [NSAttributedStringKey.paragraphStyle : paragraphStyle],
              range: NSMakeRange(0, attributedString.length))
  
          attributedString.addAttributes(
              textAttributes,
              range: NSMakeRange(0, attributedString.length))
  
          let string:NSString = NSString(string: formattedString)
          let rangeForBullet:NSRange = string.range(of: bulletPoint)
          attributedString.addAttributes(bulletAttirbutes, range: rangeForBullet)
          buffer.append(attributedString)
      }
  }
  </code></pre>
  
  <p>Do you think something is wrong with selected paragraph parameters? Because the code does almost what is expected, excluding this gap.</p>
  
  <h2>Update 1</h2>
  
  <p>Following @the4kman advice, I've changed provided code like this:</p>
  
  <pre><code>paragraphStyle.firstLineHeadIndent = indentation
  </code></pre>
  
  <p>But now I have all lines aligned with each other, including the bullet point: </p>
  
  <p><a href="https://i.stack.imgur.com/g3aAE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g3aAE.png" alt="enter image description here"></a></p>
  
  <h2>Update 2</h2>
  
  <p>Ok, the solution was quite simple - replace space with tab. See updated code below.</p>