BBCodeString is a simple library which enables you to create NSAttributedString object from bb code string.
Example of use:
NSString *bbCode = @"[user id=\"42\"]Mary Jones[/user] sent file [file id=\"23\"]Report.pdf[/file].";
BBCodeString *bbCodeString = [[BBCodeString alloc] initWithBBCode:bbCode andLayoutProvider:self];
NSAttributedString *myString = bbCodeString.attributedString;
You can simply set visual attributes for each BB code element by setting layout provider.
To run the example project, clone the repo, and run pod install
from the Example directory first.
BBCodeString is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BBCodeString"
Miha Rataj, rataj.miha@gmail.com
BBCodeString is available under the MIT license. See the LICENSE file for more info.