Challenge: Colored Text

Now that you have completed the last challenge, your users will be able to tell by reading who sent which message. However, it is still not immediately apparent visibly which messages were sent from this window controller. In receiveDidSendMessageNotification(_:), if the notification was posted by self, add an attribute to the logLine attributed string to make that line blue. You will want to use NSForegroundColorAttributeName.

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.