Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableAttributedString *finalAttributedString = [[NSMutableAttributedString alloc] initWithString:@""];
- //Do the title thing
- NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"AlMolk" ofType:@"plist"];
- NSArray *verses = [NSArray arrayWithContentsOfFile:plistPath];
- for (NSUInteger i = 0; i < [verses count]; i ++)
- {
- NSAttributedString *attr = [[NSAttributedString alloc] initWithString:verses];
- [finalAttributedString appendAttributedString:attr];
- NSTextAttachement *attachement = [NSTextAttachement alloc] init];
- NSString *imageName = [NSString stringWithFormat:verse_%02lu",(unsigned long)verseIndex];
- [attachement setImage:[UIImage imageNamed:imageName]]; //Here is supposed your images were named verse01.png etc in your app + you wan mant to resize them
- NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:attachment];
- [finalAttributedString appendAttributedString:attachmentString];
- }
- NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
- [style setAlignement:NSTextAlignmentJustified];
- NSDictionary *attributes = @{NSFontAttributeName:[UIFont [UIFont fontWithName:@"Scheherazade-Regular" size:19], NSParagraphAttributeName:style};
- [finalAttributedString addAttributes:attributes range:NSMakeRange(0, [finalAttributedString length])];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement