Darwin, the kernel and BSD subsystems, are open source. The rendering engine for Safari, called WebKit, is open source. Swift, Bonjour, and the command line toolkit are open source.
The user interface and UI APIs (including Quartz and Metal) are closed source. The Carbon and Cocoa APIs are closed source. CoreServices, CoreVideo, CoreMIDI, UIKit, WatchKit, SpriteKit, CoreData, CoreFoundation, CoreLocation, AVKit, CoreAudio, CoreMedia, MLKit, QTKit, VideoToolbox, the Apple Rest API, Automator, and so on are all closed source.