14

Can any body tell me how to add bullet list and numbered list to the selected text in UITextView.

Prerna chavan
  • 3,179
  • 7
  • 35
  • 77

1 Answers1

30

Check this question: iphone bullet point list

You might want to add the unicode char of bulletpoints to your lines (@"\u2022)

NSArray * items = ...;
NSMutableString * bulletList = [NSMutableString stringWithCapacity:items.count*30];
for (NSString * s in items)
{
   [bulletList appendFormat:@"\u2022 %@\n", s];
}
textView.text = bulletList;
Community
  • 1
  • 1
Totumus Maximus
  • 7,543
  • 6
  • 45
  • 69
  • how i can change bullets colour? – Shahbaz Akram Sep 25 '17 at 07:35
  • @MianShahbazAkram it is text so it should change as you set the textcolor. Depending on how you use these strings of course. – Totumus Maximus Sep 25 '17 at 07:51
  • basically i just want to change the color of bullets.So Please describe how i can? – Shahbaz Akram Sep 25 '17 at 09:21
  • You either have to split to bullets from the text or use something like Core Text: https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/CoreText_Programming/Introduction/Introduction.html. It is kinda out of scope for this answer though. – Totumus Maximus Sep 25 '17 at 09:31