How are any of these divergent between MacOs and iOS? You still link against the same framework, and the code is nearly identical between the two except for occasional differences in the hardware limitations.
Go look at any of Apple’s sample code. Outside of UIKit/Appkit, most of their samples target both platforms simultaneously