Challenge 2


#1

so I have created two BOOL bold and italic, also I have created a couple IBAction methods to keep track of the checkmark state (ie. set the BOOL based on the state) and in my
drawStringCenteredIn: method I have added the followings:

[code]
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSFont *currentFont = [attributes objectForKey:NSFontAttributeName];

if (bold)
    currentFont = [fontManager convertFont:currentFont toHaveTrait:NSBoldFontMask];
else
    currentFont = [fontManager convertFont:currentFont toHaveTrait:NSUnboldFontMask];

if (italic)
    currentFont = [fontManager convertFont:currentFont toHaveTrait:NSItalicFontMask];
else
    currentFont = [fontManager convertFont:currentFont toHaveTrait:NSUnitalicFontMask];


[attributes setObject:currentFont forKey:NSFontAttributeName];[/code]

#2

What’s the question? lol