How can i add bullet points to my application as shown below.
something like this;
I will have a String in the format of "one , list item, list item" i need it to be broken down to -
- one
- List item
- List item
How can i add bullet points to my application as shown below.
something like this;
I will have a String in the format of "one , list item, list item" i need it to be broken down to -
You can use Unicode characters:
NSString *stringWithBullets = @"\u00b7 one";
will produce:
• one
I've used this to make a bullet list from a NSMutableArray of NSString's and display it in a UITextView:
NSMutableArray * items = [[NSMutableArray alloc]initWithObjects:@"1:00",@"2:00",@"3:00",@"4:00",@"5:00",@"6:00",@"7:00",@"8:00",@"9:00",@"10:00",@"11:00",@"12:00", nil];
NSMutableString * bulletList = [NSMutableString stringWithCapacity:items.count*10];
for (NSString *aString in items)
{
[bulletList appendFormat:@"\n\u2022 %@", aString]; //\u2022 bullet symbol
}
self.myTextView.text = bulletList;
Also check out the Unicode characters: