I've created a .xib file with a uiview solely for the pdf document that I have created. I've primarily followed this tutorial for code:
From the above, I can't edit labels (plain or attributed) from the interface builder as even after changing size, it doesn't apply when the app is run. (I suspect the issue may lie within the methods drawText or drawLabels).
I then tried to create an attributed string, however the methods don't take it. I tried to convert the drawtext by copying and taking the argument of an nsmutableattributedstring however this caused problems with the CFStringRef.
I appreciate your time for any help.
Best How To :
Solved it by making a separate method as below (I used + since I have this inside an NSObject and is a class method rather than in a UIViewController):
+(void)addText:(NSString*)text withFrame:(CGRect)frame withFont:(UIFont*)font;
[text drawInRect:frame withFont:font];
Outside the method, declaring inputs and calling it:
UIFont *font = [UIFont fontWithName:@Helvetica-Bold" size:7];
[self addText: yourStringHere
withFrame:CGRectMake(yourXPosition, yourYPOsition, yourFrameWidth, yourFrameHeight)
I wonder if it's much simplified like so because the tutorial I used is now outdated?
If anything I hope this helps others :)