macOS Utility Using XPC and swiftUI

macOS Utility Using XPC and swiftUI

This Tech Talk describes the creation of a windowed macOS application using an XPC service for interprocess communication and a background timer to update the user interface on an interval. In this case, the motivation was to regain the temperature sensor data formerly displayed in the pre-Catalina macOS Notification Center. To accomplish this, automatically-created XPC service files are converted to swift and connected to a collection of C functions for requesting temperature values from hardware sensors supplied by the System Management Controller (SMC). A background timer is used to request the temperature sensor data from the XPC service and to publish the returned values to both a windowed swiftUI user interface (UI) and a Today View widget in the macOS Notification Center. An independent timer is used to similarly request the temperature data and publish them to a taskbar item.

macOS Utility Using XPC and swiftUI

Categories


Tags