Nuisance Factor

Follow @NuisanceFactor on Micro.blog.

Cocoa vs. Darwin

General Topic: 100 Days of SwiftUI

Summary: PH says to use import Cocoa but import Darwin works instead.

Working through (at least part of) Day 7, on this page PH says “…our playground has always had import Cocoa…” but my playground never has.  I’m running Xcode 13.2 just as he recommends, on Monterey (12.1), but my playground complains that there’s No such module when I try importing Cocoa.  And in fact, I didn’t type import Darwin—Xcode did it for me.  I just typed sqrt, ran the playground, and discovered the import at the top.

A question on Stack Overflow has a couple of very informative answers, one from Rob Napier (@cocoaphony).

And finally, I’m curious to see how this looks on the blog in Safari.  The pre button in the MarsEdit post editor seemed to want to format the entire paragraph and the custom formatting macro that I wrote added more line breaks than I needed, so I wound up choosing a monospace font and mashing the B button.  Ick, but I’m trying to stay focused on SwiftUI.