iCloud Key Value storage check if logged in to iCloud?

Is there a way to check on macOS (with Objective-C) whether or not a user is logged in to iCloud.

Id like to present a window notifying users to log in (if they're not) when they select to iCloud Sync in a macOS app.